customize-cra
Advanced tools
Comparing version
@@ -63,3 +63,3 @@ const curry = require("lodash.curry"); | ||
const override = (...plugins) => config => flow(...plugins.map(f => f || (a => a)))(config); | ||
const override = (...plugins) => flow(...plugins.filter(f => f)); | ||
@@ -66,0 +66,0 @@ module.exports = { |
{ | ||
"name": "customize-cra", | ||
"version": "0.1.0-beta5", | ||
"version": "0.1.0-beta6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,3 +59,3 @@ # customize-cra | ||
To use these plugins, import the `override` function, and call it with whatever plugins you need. Each of these plugin invocations will return a new function, that `override` will call with the newly modified config object. This means that if you need to conditionally apply any of these plugins, just provide a lambda that receives the config object, and conditionally invoke a plugin as needed, being sure to call it twice. | ||
To use these plugins, import the `override` function, and call it with whatever plugins you need. Each of these plugin invocations will return a new function, that `override` will call with the newly modified config object. Falsy values will be ignored though, so if you need to conditionally apply any of these plugins, you can do so like below. | ||
@@ -71,3 +71,3 @@ For example | ||
disableEsLint(), | ||
config => (process.env.BUNDLE_VISUALIZE == 1 ? addBundleVisualizer()(config) : config), | ||
process.env.BUNDLE_VISUALIZE == 1 && addBundleVisualizer(), | ||
addWebpackAlias({ ["ag-grid-react$"]: path.resolve(__dirname, "src/shared/agGridWrapper.js") }) | ||
@@ -74,0 +74,0 @@ ); |
5341
-2.45%