1 Star 0 Fork 1

lidonghui-gitee/vue-element

forked from TMP/vue-element 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vue.config.js 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
DONGLEI 提交于 2023-11-22 15:21 . 😆😆😆😆😆
'use strict'
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const path = require('path')
const defaultSettingS = require('./src/setting')
const name = defaultSettingS.title
function resolve (dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: './',
// outputDir: 'dev',
assetsDir: 'static',
indexPath: 'index.html',
productionSourceMap: false,
configureWebpack: {
name: name,
resolve: {
alias: {
'@': resolve('src')
}
}
},
chainWebpack: config => {
config.plugins.delete('prefetch')
config.module.rule('svg').exclude.add(resolve('src/icons')).end()
config.module.rule('icons').test(/\.svg$/).include.add(resolve('src/icons')).end().use('svg-sprite-loader').loader('svg-sprite-loader').options({ symbolId: 'icon-[name]' }).end()
config.when(process.env.NODE_ENV !== 'development', con => {
con.plugin('ScriptExtHtmlWebpackPlugin').after('html').use('script-ext-html-webpack-plugin', [{ inline: /runtime\..*\.js$/ }]).end()
con.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial'
}
}
})
con.optimization.runtimeChunk('single')
con.plugin('compressionPlugin').use(
new CompressionWebpackPlugin({
algorithm: 'gzip',
test: new RegExp('\\.(' + ['js', 'css'].join('|') + ')$'),
threshold: 10240,
minRatio: 0.8
})
)
})
},
devServer: {
open: false,
host: '0.0.0.0',
port: 8080,
https: false,
hot: true,
hotOnly: false,
overlay: {
warnings: true,
errors: true
},
proxy: {
'/bigdata/risk': {
target: 'http://dev-p0408-b007-bigdata-risk-platform:30080',
changeOrigin: true,
pathRewrite: {
'^/bigdata/risk': '/bigdata/risk'
}
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/lidonghuigitee/vue-element_1.git
git@gitee.com:lidonghuigitee/vue-element_1.git
lidonghuigitee
vue-element_1
vue-element
master

搜索帮助