Created
November 20, 2018 09:45
-
-
Save agileago/52cf2076aba823280037e9f5f9e03d31 to your computer and use it in GitHub Desktop.
vue config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
function resolve(dir) { | |
return path.join(__dirname, '.', dir) | |
} | |
module.exports = { | |
baseUrl: './', | |
productionSourceMap: false, | |
chainWebpack: config => { | |
config.plugins.delete('preload') | |
// config.plugins.delete('prefetch') | |
config | |
.plugin('html') | |
.tap(args => { | |
args[0].minify = false | |
return args | |
}) | |
config.externals({ | |
'vue': 'Vue', | |
'vue-router': 'VueRouter', | |
'vuex': 'Vuex' | |
}) | |
config.module.rules.delete('svg') | |
config.module | |
.rule('svg-sprite-loader') | |
.test(/\.svg$/) | |
.include | |
.add(resolve('src/icons')) //处理svg目录 | |
.end() | |
.use('svg-sprite-loader') | |
.loader('svg-sprite-loader') | |
.options({ | |
symbolId: 'icon-[name]' | |
}) | |
}, | |
devServer: { | |
disableHostCheck: true | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment