vue.config.js 配置
module.exports = {
publicPath: "/website",
lintOnSave: true,
productionSourceMap: false,
chainWebpack: (config) => {
config.externals({
'vue': 'Vue',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'element-ui': 'ELEMENT',
});
const entry = config.entry('app');
entry.add('babel-polyfill').end();
entry.add('classlist-polyfill').end();
entry.add('@/mock').end();
},
css: {
extract: { ignoreOrder: true }
},
devServer: {
port: 8095,
proxy: {
'/api': {
target: 'http://localhost:8090',
ws: true,
pathRewrite: {
'^/api': '/'
}
}
}
}
};