mirror of https://gitee.com/answerdev/answer.git
chore: split main.js
This commit is contained in:
parent
17b7e9c7b8
commit
92cc1e6a5d
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue