/** * 配置该文件可以参考: * https://cli.vuejs.org/zh/config/#%E7%9B%AE%E6%A0%87%E6%B5%8F%E8%A7%88%E5%99%A8 * */ const url = 'http://127.0.0.1:9998' // 基础路径,发布前修改这里,当前配置打包出来的资源都是相对路径 let publicPath = './' module.exports = { publicPath: publicPath, lintOnSave: true, productionSourceMap: false, css: { // 忽略 CSS order 顺序警告 extract: { ignoreOrder: true } }, chainWebpack: config => { const entry = config.entry('app') entry .add('babel-polyfill') .end() entry .add('classlist-polyfill') .end() }, configureWebpack: config => { // 为生产环境修改配置... if (process.env.NODE_ENV === 'production') { config.mode = 'production'; // 打包文件大小配置 config.performance = { maxEntrypointSize: 10000000, maxAssetSize: 30000000 } } }, // 配置转发代理 devServer: { proxy: { '/': { target: url, ws: true, pathRewrite: { '^/': '/' } } } } }