const path = require('path') const pxtorem = require('postcss-pxtorem') 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: 'https://zlzd.zrzyt.zj.gov.cn/app215/ybz-api/', // 服务器端接口地址 ws: true, // 如果要代理 websockets,配置这个参数 // 如果是https接口,需要配置这个参数 changeOrigin: true, // 是否跨域 pathRewrite: { '^/ysgzybz': '/' } }, '/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` // } // ]) // } css: { extract: { ignoreOrder: true }, loaderOptions: { postcss: { plugins: [ pxtorem({ rootValue: 37.5,//这个尺寸可以根据自己的图去配置,这里配置的是宽度375的图(如果用了vant插件) propList: ['*'], selectorBlackList: ['van-circle__layer'] }) ] } } } }