customize-cra
Advanced tools
Comparing version 0.0.6 to 0.1.0-beta1
32
index.js
@@ -1,2 +0,5 @@ | ||
function addBundleVisualizer(config) { | ||
const curry = require("lodash.curry"); | ||
const flow = require("lodash.flow"); | ||
const addBundleVisualizer = () => config => { | ||
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin; | ||
@@ -11,5 +14,5 @@ | ||
return config; | ||
} | ||
}; | ||
function addBabelPlugin(plugin, config, env) { | ||
const addBabelPlugin = plugin => config => { | ||
let rulesWithBabel = config.module.rules.filter( | ||
@@ -31,10 +34,10 @@ r => r.oneOf && r.oneOf.some(r => Array.isArray(r.use) && r.use.some(u => u.options && u.options.babelrc != void 0)) | ||
return config; | ||
} | ||
}; | ||
function addDecoratorsLegacy(config, env) { | ||
const addDecoratorsLegacy = () => config => { | ||
addBabelPlugin(["@babel/plugin-proposal-decorators", { legacy: true }], config, env); | ||
return config; | ||
} | ||
}; | ||
function disableEsLint(config, env) { | ||
const disableEsLint = () => config => { | ||
let eslintRules = config.module.rules.filter(r => r.use && r.use.some(u => u.options && u.options.useEslintrc != void 0)); | ||
@@ -45,5 +48,5 @@ eslintRules.forEach(rule => { | ||
return config; | ||
} | ||
}; | ||
function addWebpackAlias(alias, config) { | ||
const addWebpackAlias = alias => config => { | ||
if (!config.resolve) { | ||
@@ -57,5 +60,14 @@ config.resolve = {}; | ||
return config; | ||
} | ||
}; | ||
const override = (...pipeline) => (config, env) => | ||
flow( | ||
...pipeline.map(f => { | ||
const curried = curry(f, 2); | ||
return curried(curry.placeholder, env); | ||
}) | ||
)(config); | ||
module.exports = { | ||
override, | ||
addBundleVisualizer, | ||
@@ -62,0 +74,0 @@ addBabelPlugin, |
{ | ||
"name": "customize-cra", | ||
"version": "0.0.6", | ||
"version": "0.1.0-beta1", | ||
"description": "", | ||
@@ -9,4 +9,8 @@ "main": "index.js", | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
"author": "Adam Rackis", | ||
"license": "MIT", | ||
"dependencies": { | ||
"lodash.curry": "^4.1.1", | ||
"lodash.flow": "^3.5.0" | ||
} | ||
} |
# customize-cra | ||
This project piggybacks on `react-app-rewired` to customize create-react-app for version 2.0 and higher. | ||
This project piggybacks on [`react-app-rewired`](https://github.com/timarney/react-app-rewired/) to customize create-react-app for version 2.0 and higher. | ||
@@ -5,0 +5,0 @@ To start, this project will export methods I need for what I'm using CRA for, but PRs will of course be welcome. |
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
4348
4
77
1
2
+ Addedlodash.curry@^4.1.1
+ Addedlodash.flow@^3.5.0
+ Addedlodash.curry@4.1.1(transitive)
+ Addedlodash.flow@3.5.0(transitive)