优化代码

pull/4/head
smallchill 7 years ago
parent 05f764bac5
commit 54eb7988f4
  1. 64
      vue.config.js

@ -2,38 +2,38 @@
let baseUrl = './' let baseUrl = './'
let url = 'http://localhost:8800' let url = 'http://localhost:8800'
module.exports = { module.exports = {
publicPath: baseUrl, // 根据你的实际情况更改这里 publicPath: baseUrl, // 根据你的实际情况更改这里
lintOnSave: true, lintOnSave: true,
productionSourceMap: false, productionSourceMap: false,
chainWebpack: (config) => { chainWebpack: (config) => {
//忽略的打包文件 //忽略的打包文件
config.externals({ config.externals({
'vue': 'Vue', 'vue': 'Vue',
'vue-router': 'VueRouter', 'vue-router': 'VueRouter',
'vuex': 'Vuex', 'vuex': 'Vuex',
'axios': 'axios', 'axios': 'axios',
'element-ui': 'ELEMENT', 'element-ui': 'ELEMENT',
}) })
const entry = config.entry('app') const entry = config.entry('app')
entry entry
.add('babel-polyfill') .add('babel-polyfill')
.end() .end()
entry entry
.add('classlist-polyfill') .add('classlist-polyfill')
.end() .end()
entry entry
.add('@/mock') .add('@/mock')
.end() .end()
}, },
devServer: { devServer: {
proxy: { proxy: {
'/api': { '/api': {
target: url, target: url,
ws: true, ws: true,
pathRewrite: { pathRewrite: {
'^/api': '/' '^/api': '/'
}
}
} }
}
} }
}
} }

Loading…
Cancel
Save