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: 'static', lintOnSave: false, productionSourceMap: false, devServer: { // 端口号 port: 8880, // host: '0.0.0.0', // https:{type:Boolean} https: false, // 配置自动启动浏览器 open: true, // 忽略eslint编译检查 overlay: { warnings: false, errors: false }, // proxy:{ // '/rlc-quota/': { // target: 'http://10.10.16.114/rlc-quota/', // ws: true, // changOrigin: true, // 是否开启代理 // pathRewrite: { // '^/rlc-quota/': '' // } // }, // } // proxy: 'http://10.10.16.114/rlc-cts/' // liangchu // proxy: 'http://10.10.16.114/rlc-cts/'// test // 配置跨域处理,只有一个代理 }, chainWebpack: config => { config.plugins.delete('prefetch') config.resolve.alias .set("@", resolve("src")) .set("static", resolve("src/static")) }, 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' }, ] } } }) ] } } }