const path = require('path'); module.exports = { publicPath: `/`, // 打包文件 outputDir: 'platlive', 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'), }, }, }); }, css: { loaderOptions: { less: { globalVars: { hack: `true; @import '~@/assets/less/var.less';`, }, }, }, }, devServer: { port: '8001', //api地址前缀 proxy: { '/hqserver': { target: 'https://www.ilikegou.cn', //http://192.168.1.19:9101 changeOrigin: true, ws: false, // pathRewrite: { // // 路径重写 // '/api': '', // 这个意思就是以api开头的,定向到哪里, 如果你的后边还有路径的话, 会自动拼接上 // }, }, }, }, };