vue.config.js
function resolve (dir) {
return path.join(__dirname, dir)
}
const ignored = ['**/uni_modules/**/*.md', '**/uni_modules/**/package.json', '**/uni_modules/*/uniCloud/**/*']
module.exports = {
configureWebpack() {
return {
watchOptions: {
ignored
},
devServer: {
watchOptions: {
ignored
}
}
}
},
chainWebpack(config) {
// config.plugins.delete('preload') // TODO: need test
// config.plugins.delete('prefetch') // TODO: need test
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('assets/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('assets/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
}
}
package.json
"dependencies": {
"element-ui": "2.15.5",
"fuse.js": "3.4.4",
"js-cookie": "^2.2.1",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"screenfull": "4.2.0",
"uni-simple-router": "^1.5.3"
},
"devDependencies": {
"svg-sprite-loader": "^5.1.1"
} ```