4 Star 1 Fork 0

李万松 / dfzqweb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 2.46 KB
一键复制 编辑 原始数据 按行查看 历史
liwansong 提交于 2020-05-08 17:07 . 东方证券前端代码上传
'use strict'
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: '/dfzq-qxgl',
outputDir: 'dist',
assetsDir: 'static',
productionSourceMap: false,
devServer: {
port: 8081,
open: true,
overlay: {
warnings: false,
errors: true
},
proxy: {
'/api': {
target: `http://127.0.0.1:8081/mock`,
changeOrigin: true
}
// '/api': {
// target: 'http://genesis.orientsec.com.cn:8000',
// changeOrigin: true,
// headers: {
// 'X-Forwarded-For': 'localhost:8081'
// }
// },
// '/gateway': {
// target: 'http://genesis.orientsec.com.cn:8000',
// changeOrigin: true,
// headers: {
// 'X-Forwarded-For': 'localhost:8081'
// }
}
},
configureWebpack: {
name: 'genesis-frontend-template',
resolve: {
alias: {
'@': resolve('src')
}
}
},
chainWebpack(config) {
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/assets/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/assets/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
// set preserveWhitespace
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
})
.end()
config.when(process.env.NODE_ENV === 'development', config =>
config.devtool('cheap-source-map')
)
config.when(process.env.NODE_ENV !== 'development', config => {
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial'
},
genesisUI: {
name: 'chunk-genesisUI',
priority: 20,
test: /[\\/]node_modules[\\/]_?genesis-ui(.*)/
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'),
minChunks: 3,
priority: 5,
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single')
})
}
}
1
https://gitee.com/aozheliwansong/dfzqweb.git
git@gitee.com:aozheliwansong/dfzqweb.git
aozheliwansong
dfzqweb
dfzqweb
master

搜索帮助