const path = require('path') const FileManagerPlugin = require('filemanager-webpack-plugin') function resolve(dir) { return path.join(__dirname, dir) } // webpack mode const mode = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'someone' ? 'development' : 'production' module.exports = { publicPath: process.env.VUE_APP_WEB_PREFIX, outputDir: 'dist', assetsDir: 'assets', lintOnSave: false, productionSourceMap: false, devServer: { // 端口号 port: 2323, // host: '0.0.0.0', // https:{type:Boolean} https: false, // 配置自动启动浏览器 open: true, // 忽略eslint编译检查 overlay: { warnings: false, errors: false }, // proxy: 'http://10.10.16.114/rlc-cts/'// test // 配置跨域处理,只有一个代理 proxy: { // 配置跨域 '/fs-adm': { // target: process.env.VUE_APP_API_ORIGIN, target: 'http://10.1.1.166:24200', // http://10.1.1.166:24200 http://10.1.1.163 ws: true, changOrigin: true, // 是否开启代理 pathRewrite: { '^/fs-adm': '/fs-adm' } }, '/rlc-cts': { target: 'http://10.1.1.163', // http://10.1.1.166:24200 http://10.1.1.163 ws: true, changOrigin: true, // 是否开启代理 pathRewrite: { '^/rlc-cts': '/rlc-cts' } } }, }, chainWebpack: config => { config.plugins.delete('prefetch') }, configureWebpack: config => { return { mode, resolve: { alias: { vue$: 'vue/dist/vue.esm.js', '@': resolve('src') } }, plugins: [ new FileManagerPlugin({ events: { onEnd: { delete: [ './dist/dist.zip', ], archive: [ { source: './dist', destination: './dist/dist.zip' }, ] } } }) ] } } }