123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- const path = require('path')
- const version = new Date().getTime();
- module.exports = {
- lintOnSave: false,
- // lintOnSave: process.env.NODE_ENV !== 'production',
- publicPath: './', // 基本路径
- outputDir: 'dist', // 输出文件目录
- assetsDir: './assets',
- productionSourceMap: false,
- transpileDependencies: ['@supermap/iclient-common', '@supermap/iclient-leaflet'],
- devServer: {
- host: '0.0.0.0', // can be overwritten by process.env.HOST
- port: 8082, // 端口配置
- proxy: {
- "/arcMapServer/": {
- target: "http://10.36.128.38/", // 服务器端接口地址
- // target: "http://59.202.43.95:8801/spaceproject/",
- ws: true, //如果要代理 websockets,配置这个参数
- // 如果是https接口,需要配置这个参数
- changeOrigin: true, //是否跨域
- pathRewrite: {
- "^/arcMapServer": "/"
- }
- },
- "/arcMapServerTwo": {
- target: "http://10.249.2.51:6080/", // 服务器端接口地址
- ws: true, //如果要代理 websockets,配置这个参数
- // 如果是https接口,需要配置这个参数
- changeOrigin: true, //是否跨域
- pathRewrite: {
- "^/arcMapServerTwo": "/"
- }
- },
- '/ysgzybz': {
- // target: 'http://59.202.43.95:8801/kjzz/', // 服务器端接口地址
- target: 'http://localhost:7089/', // 服务器端接口地址
- ws: true, // 如果要代理 websockets,配置这个参数
- // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 是否跨域
- pathRewrite: {
- '^/clzy': '/'
- }
- },
- '/arcMapServer2': {
- // target: 'http://59.202.43.95:8801/kjzz/', // 服务器端接口地址
- target: 'https://zdzy.zrzyt.zj.gov.cn/', // 服务器端接口地址
- ws: true, // 如果要代理 websockets,配置这个参数
- // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 是否跨域
- pathRewrite: {
- '^/arcMapServer2': '/arcMapServer'
- }
- },
- '/gdzb': {
- target: 'https://gdzb.zrzyt.zj.gov.cn:10200/', // 服务器端接口地址
- ws: true, // 如果要代理 websockets,配置这个参数
- changeOrigin: true, // 是否跨域
- pathRewrite: {
- '^/gdzb': '/'
- }
- },
- '/zdzg': {
- target: 'https://kjly.zrzyt.zj.gov.cn:8184/', // 服务器端接口地址
- ws: true, // 如果要代理 websockets,配置这个参数
- changeOrigin: true, // 是否跨域
- pathRewrite: {
- '^/zdzg': '/'
- }
- },
- },
- overlay: {
- warnings: true,
- errors: false
- }
- },
- configureWebpack: {
- output: {
- sourcePrefix: " ",
- filename: `js/[name].${version}.js`,
- chunkFilename: `js/[name].${version}.js`
- },
- amd: {
- toUrlUndefined: true
- },
- resolve: {
- alias: {
- 'vue$': 'vue/dist/vue.esm.js',
- '@': path.resolve('src'),
- 'txml/txml': 'txml/dist/txml'
- // 'cesium': path.resolve(__dirname, cesiumSource)
- }
- },
- plugins: [
- // new CopyWebpackPlugin([{ from: path.join(cesiumSource, cesiumWorkers), to: 'Workers' }]),
- // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'Assets'), to: 'Assets' }]),
- // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'Widgets'), to: 'Widgets' }]),
- // new CopyWebpackPlugin([{ from: path.join(cesiumSource, 'ThirdParty/Workers'), to: 'ThirdParty/Workers' }]),
- // new webpack.DefinePlugin({
- // CESIUM_BASE_URL: JSON.stringify('./')
- // })
- ],
- module: {
- unknownContextCritical: /^.\/.*$/,
- unknownContextCritical: false
- }
- },
- // 给css添加版本号
- // chainWebpack: config => {
- // config.plugin('extract-css').tap(args => [
- // {
- // filename: `assets/css/[name].${version}.css`,
- // chunkFilename: `assets/css/[name].${version}.css`
- // }
- // ])
- // }
- }
|