标签:resolve module .config == const one turn === ports
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
// publicPath: process.env.NODE_ENV === 'production'?'/':'/',
// i18n
chainWebpack: config => {
config.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use('i18n')
.loader('@kazupon/vue-i18n-loader')
.end()
//配置别名
config.resolve.alias
.set('@', resolve('src'))
.set('components', resolve('src/components'))
.set('views', resolve('src/views'))
.set('utils', resolve('src/utils'))
},
//打包后关闭sourece map
productionSourceMap: false,
//跨域
devServer: {
proxy: {
'/apk': {
target: 'https://gitee.com',
changeOrigin: true,
pathRewrite: {
'^/apk': ''
}
}
}
}
}
标签:resolve module .config == const one turn === ports
原文地址:https://www.cnblogs.com/ak-b/p/10525479.html