/** * author * 2018-11-5 * webpack 相关配置 */ const path = require('path') const resolve = dir => path.join(__dirname, dir) const ds_overlay = { warnings: true, errors: true } const ds_proxy = { '/': { ws: false, target: 'https://dev.test.proginn.com/', changeOrigin: true, // pathRewrite: { // '/api/dispatch': '/dispatch' // } }, } module.exports = { publicPath: process.env.NODE_ENV === 'production' ? './' : '/', chainWebpack: config => { config.entry.vender = ['echarts', 'vue', 'vuex', 'vue-router', 'element-ui'] config.resolve.alias .set('module',resolve('src/module')) .set('static',resolve('src/static')) .set('utils',resolve('src/utils')) config.devServer .set('historyApiFallback', false) .set('noInfo', true) .set('open', true) .set('quiet', true) .set('overlay', ds_overlay) .set('proxy', ds_proxy) .set('disableHostCheck', true) }, }