customize-cra
Advanced tools
Comparing version 0.0.3 to 0.0.4
13
index.js
@@ -41,2 +41,12 @@ function addBundleVisualizer(config) { | ||
function addWebpackAlias(alias, config) { | ||
if (!config.resolve) { | ||
config.resolve = {}; | ||
} | ||
if (!config.resolve.alias) { | ||
config.resolve.alias = {}; | ||
} | ||
Object.assign(config.resolve.alias, aliass); | ||
} | ||
module.exports = { | ||
@@ -46,3 +56,4 @@ addBundleVisualizer, | ||
addDecoratorsLegacy, | ||
disableEsLint | ||
disableEsLint, | ||
addWebpackAlias | ||
}; |
{ | ||
"name": "customize-cra", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,16 +13,27 @@ # customize-cra | ||
## Warning | ||
> "Stuff can break" | ||
> \- Dan Abramov | ||
Using this library will override default behavior and configuration of create-react-app, and therefore invalidate the guarentees that come with it. Use with discretion! | ||
## Docs | ||
### addBabelPlugin(plugin, config, env) | ||
### addBabelPlugin(plugin, config) | ||
Adds a babel plugin. Not sure what else to say here. | ||
### addDecoratorsLegacy(config, env) | ||
### addDecoratorsLegacy(config) | ||
Add decorators in legacy mode. Be sure to have `@babel/plugin-proposal-decorators` installed. | ||
### disableEsLint(config, env) | ||
### disableEsLint(config) | ||
Does what it says. You may need this along with `addDecoratorsLegacy` in order to get decorators and exports to parse together. | ||
### addWebpackAlias(alias, config) | ||
Adds the provided alias info into webpack's alias section. Pass an object literal with as many entries as you'd like, and the whole object will be merged in. | ||
### addBundleVisualizer(config) | ||
@@ -39,5 +50,5 @@ | ||
module.exports = function override(config, env) { | ||
addDecoratorsLegacy(config, env); | ||
disableEsLint(config, env); | ||
module.exports = function override(config) { | ||
addDecoratorsLegacy(config); | ||
disableEsLint(config); | ||
@@ -44,0 +55,0 @@ return config; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3482
50
56