Commit 8cd2ada0 by xinlaa

增加优化配置与代码提示

1 parent 221fd1ff
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
...@@ -75,6 +75,18 @@ module.exports = { ...@@ -75,6 +75,18 @@ module.exports = {
}) })
.end() .end()
config.plugin('preload').tap(() => [
{
rel: 'preload',
// to ignore runtime.js
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial',
},
])
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
config.when(process.env.NODE_ENV !== 'development', (config) => { config.when(process.env.NODE_ENV !== 'development', (config) => {
config config
.plugin('ScriptExtHtmlWebpackPlugin') .plugin('ScriptExtHtmlWebpackPlugin')
...@@ -86,6 +98,13 @@ module.exports = { ...@@ -86,6 +98,13 @@ module.exports = {
}, },
]) ])
.end() .end()
config.optimization.minimizer('terser').tap((options) => {
options[0].terserOptions.compress.drop_console = true
options[0].terserOptions.compress.drop_debugger = true
return options
})
config.optimization.splitChunks({ config.optimization.splitChunks({
chunks: 'all', chunks: 'all',
cacheGroups: { cacheGroups: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!