halo-admin/vue.config.js

57 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-03-20 12:22:52 +00:00
const path = require('path')
const webpack = require('webpack')
2019-03-22 02:14:41 +00:00
function resolve(dir) {
2019-03-20 12:22:52 +00:00
return path.join(__dirname, dir)
}
2019-12-23 04:54:15 +00:00
2019-03-20 12:22:52 +00:00
// vue.config.js
2019-03-19 02:34:57 +00:00
module.exports = {
publicPath: process.env.PUBLIC_PATH,
2019-03-20 12:22:52 +00:00
configureWebpack: {
plugins: [
2019-05-07 15:12:51 +00:00
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
2020-03-28 07:26:05 +00:00
]
2019-03-20 12:22:52 +00:00
},
chainWebpack: (config) => {
config.resolve.alias
.set('@$', resolve('src'))
.set('@api', resolve('src/api'))
.set('@assets', resolve('src/assets'))
.set('@comp', resolve('src/components'))
.set('@views', resolve('src/views'))
.set('@layout', resolve('src/layout'))
.set('@static', resolve('src/static'))
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
.oneOf('inline')
.resourceQuery(/inline/)
.use('vue-svg-icon-loader')
.loader('vue-svg-icon-loader')
.end()
.end()
.oneOf('external')
.use('file-loader')
.loader('file-loader')
.options({
name: 'assets/[name].[hash:8].[ext]'
})
},
css: {
loaderOptions: {
less: {
javascriptEnabled: true
}
}
},
lintOnSave: undefined,
// babel-loader no-ignore node_modules/*
transpileDependencies: [],
productionSourceMap: false
2019-03-20 12:22:52 +00:00
}