postcss-modules-values-replace
Advanced tools
Comparing version 3.0.1 to 3.1.0
13
index.js
@@ -135,4 +135,11 @@ const postcss = require('postcss'); | ||
const factory = ({ fs = nodeFs, resolve: options = {} } = {}) => async (root, rootResult) => { | ||
const resolver = ResolverFactory.createResolver(Object.assign({ fileSystem: fs }, options)); | ||
const factory = ({ | ||
fs = nodeFs, | ||
noEmitExports = false, | ||
resolve: resolveOptions = {}, | ||
} = {}) => async (root, rootResult) => { | ||
const resolver = ResolverFactory.createResolver(Object.assign( | ||
{ fileSystem: fs }, | ||
resolveOptions, | ||
)); | ||
const resolve = promisify(resolver.resolve, resolver); | ||
@@ -164,2 +171,4 @@ const readFile = promisify(fs.readFile, fs); | ||
node.params = replaceValueSymbols(node.params, definitions); | ||
} else if (noEmitExports && node.type === 'atrule' && node.name === 'value') { | ||
node.remove(); | ||
} | ||
@@ -166,0 +175,0 @@ }); |
{ | ||
"name": "postcss-modules-values-replace", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "PostCSS plugin to work around CSS Modules values limitations", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -83,11 +83,31 @@ # PostCSS Modules Values Replace [![Build Status][ci-img]][ci] | ||
#### fs `Object` | ||
#### fs `Object` | ||
File system to use. To make it faster in webpack pass its file system to plugin. | ||
Cached Node's file system is used by default. | ||
Cached Node's file system is used by default. | ||
#### resolve `Object` | ||
[enhanced-resolve]'s configuration object, see there for possible options and defaults. | ||
[enhanced-resolve]'s configuration object, see there for possible options and defaults. | ||
#### noEmitExports `boolean` | ||
When enabled @value rules/declarations will be removed from the emitted output | ||
**Input:** | ||
```css | ||
@value myBrandColor blue; | ||
@font-face {} | ||
body { background: myBrandColor } | ||
``` | ||
**Output:** | ||
```css | ||
@font-face {} | ||
body { background: blue } | ||
``` | ||
### calc() and @value | ||
@@ -158,3 +178,3 @@ | ||
[postcss-calc] and [postcss-color-function] are known to work *inside* **@value** as they traverse media queries. | ||
Experience with other plugins may differ if they ignore media queries. | ||
Experience with other plugins may differ if they ignore media queries. | ||
@@ -161,0 +181,0 @@ ### Extracting values for programmatic use |
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
11312
140
196