customize-cra
Advanced tools
Comparing version 0.2.8 to 0.2.9
21
index.js
@@ -99,2 +99,3 @@ const flow = require("lodash.flow"); | ||
eslintRule.use[0].options.useEslintrc = true; | ||
eslintRule.use[0].options.ignore = true; | ||
delete eslintRule.use[0].options.baseConfig; | ||
@@ -253,2 +254,19 @@ | ||
const addPostcssPlugins = (plugins) => config => { | ||
const rules = config.module.rules.find(rule => Array.isArray(rule.oneOf)) | ||
.oneOf; | ||
rules.forEach(r => r.use && r.use.forEach(u => { | ||
if (u.options && u.options.ident === "postcss") { | ||
if (!u.options.plugins) { | ||
u.options.plugins = () => [...plugins]; | ||
} | ||
if (u.options.plugins) { | ||
const originalPlugins = u.options.plugins; | ||
u.options.plugins = () => [...originalPlugins(), ...plugins]; | ||
} | ||
} | ||
})); | ||
return config; | ||
} | ||
module.exports = { | ||
@@ -273,3 +291,4 @@ override, | ||
addBabelPresets, | ||
disableChunk | ||
disableChunk, | ||
addPostcssPlugins | ||
}; |
{ | ||
"name": "customize-cra", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "repository": "arackaf/customize-cra", |
@@ -320,1 +320,19 @@ # customize-cra | ||
``` | ||
### add post-css plugins | ||
To add post-css plugins, you can use `addPostcssPlugins`. | ||
```js | ||
const { | ||
override, | ||
addPostcssPlugins | ||
} = require("customize-cra"); | ||
module.exports = override( | ||
addPostcssPlugins([ | ||
require('postcss-px2rem')({ remUnit: 37.5 }) | ||
]), | ||
); | ||
``` |
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
17425
252
337