const path = require('path'); const common = path.resolve(__dirname, '../common'); module.exports = { // 输出文件 publicPath: `/${process.env.VUE_APP_ROUTER}`, // 打包文件 outputDir: `${process.env.VUE_APP_ROUTER}`, // 静态资源 assetsDir: 'static', lintOnSave: process.env.NODE_ENV === 'development', // 问题定位 productionSourceMap: false, configureWebpack: (config) => { Object.assign(config, { resolve: { alias: { '@': path.resolve(__dirname, './src'), '@c': path.resolve(__dirname, './src/components'), '@a': path.resolve(__dirname, './src/assets'), '@common': common, }, }, }); }, devServer: { port: '8002', proxy: { [process.env.VUE_APP_BASE_URL_API]: { target: process.env.VUE_APP_REQUEST_URL, }, [process.env.VUE_APP_BASE_API]: { target: process.env.VUE_APP_REQUEST_URL, changeOrigin: true, ws: false, }, }, }, };