chore: split main.js

This commit is contained in:
shuai 2023-04-18 17:38:08 +08:00
parent 17b7e9c7b8
commit 92cc1e6a5d
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,7 @@
const {
addWebpackModuleRule,
addWebpackAlias
addWebpackAlias,
setWebpackOptimizationSplitChunks,
} = require("customize-cra");
const path = require("path");
@ -18,6 +19,13 @@ module.exports = {
use: "yaml-loader"
})(config);
setWebpackOptimizationSplitChunks({
chunks: "all",
maxInitialRequests: 20,
maxAsyncRequests: 20,
minSize: 1024 * 5,
})(config);
// add i18n dir to ModuleScopePlugin allowedPaths
const moduleScopePlugin = config.resolve.plugins.find(_ => _.constructor.name === "ModuleScopePlugin");
if (moduleScopePlugin) {