Skip to content

Commit

Permalink
Add disableChunk (#41)
Browse files Browse the repository at this point in the history
* Add `disableChunk`

Function to disable chunk or code splitting, see: facebook/create-react-app#5306 for more info

* fix: export disable chunk function
  • Loading branch information
Ievhen20 committed Dec 16, 2018
1 parent 4f667bb commit 7031443
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,20 @@ const watchAll = () => config => {
return config;
};

// to be used to disable chunk according to:
// https://github.com/facebook/create-react-app/issues/5306#issuecomment-433425838
const disableChunk = () => config => {
config.optimization.splitChunks = {
cacheGroups: {
default: false,
},
};

config.optimization.runtimeChunk = false;

return config;
};

module.exports = {
override,
addBundleVisualizer,
Expand All @@ -253,5 +267,6 @@ module.exports = {
watchAll,
babelInclude,
addBabelPreset,
addBabelPresets
addBabelPresets,
disableChunk
};

0 comments on commit 7031443

Please sign in to comment.