Reputation: 1
The application I created using create-react-app uses customize-cra and react-app-rewired to override some configurations of webpack. When I use the setWebpackOptimizationSplitChunks function and run pnpm start, the project cannot run correctly and stays at Starting. the development server... , what is the problem? Or are there other solutions that cover webpack? Because I don't want to run eject.
const {
override,
disableEsLint,
overrideDevServer,
watchAll,
setWebpackOptimizationSplitChunks,
} = require("customize-cra");
module.exports = {
webpack: override(
// usual webpack plugin
disableEsLint(),
setWebpackOptimizationSplitChunks({
chunks: 'all',
name: false,
}),
),
devServer: overrideDevServer(
// dev server plugin
watchAll()
)
};
After adding setWebpackOptimizationSplitChunks
function, run pnpm start
the command line will be stuck at
setWebpackOptimizationSplitChunks
can run normally if this function is removed.
react version is 18.2.0
Upvotes: 0
Views: 68