postcss-colormin 5.2.2 → 5.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -100,7 +100,7 @@ function pluginCreator(config = {}) {
|
|
|
100
100
|
path: __dirname,
|
|
101
101
|
env: resultOptions.env
|
|
102
102
|
});
|
|
103
|
-
const cache =
|
|
103
|
+
const cache = new Map();
|
|
104
104
|
const options = addPluginDefaults(config, browsers);
|
|
105
105
|
return {
|
|
106
106
|
OnceExit(css) {
|
|
@@ -121,14 +121,14 @@ function pluginCreator(config = {}) {
|
|
|
121
121
|
browsers
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
if (cache
|
|
125
|
-
decl.value = cache
|
|
124
|
+
if (cache.has(cacheKey)) {
|
|
125
|
+
decl.value = cache.get(cacheKey);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
const newValue = transform(value, options);
|
|
130
130
|
decl.value = newValue;
|
|
131
|
-
cache
|
|
131
|
+
cache.set(cacheKey, newValue);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
|
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "postcss-colormin",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"description": "Minify colors in your CSS files with PostCSS.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
8
8
|
"LICENSE-MIT"
|
|
9
9
|
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"prebuild": "rimraf dist",
|
|
12
|
-
"build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\"",
|
|
13
|
-
"prepare": "yarn build"
|
|
14
|
-
},
|
|
15
10
|
"keywords": [
|
|
16
11
|
"color",
|
|
17
12
|
"colors",
|
|
@@ -46,5 +41,10 @@
|
|
|
46
41
|
},
|
|
47
42
|
"peerDependencies": {
|
|
48
43
|
"postcss": "^8.2.15"
|
|
49
|
-
}
|
|
50
|
-
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"prebuild": "rimraf dist",
|
|
47
|
+
"build": "babel src --config-file ../../babel.config.json --out-dir dist --ignore \"**/__tests__/\""
|
|
48
|
+
},
|
|
49
|
+
"readme": "# [postcss][postcss]-colormin\n\n> Minify colors in your CSS files with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-colormin) do:\n\n```\nnpm install postcss-colormin --save\n```\n\n\n## Example\n\n```js\nvar postcss = require('postcss')\nvar colormin = require('postcss-colormin');\n\nvar css = 'h1 {color: rgba(255, 0, 0, 1)}';\nconsole.log(postcss(colormin()).process(css).css);\n\n// => 'h1 {color:red}'\n```\n\nFor more examples see the [tests](src/__tests__/index.js).\n\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n\n[postcss]: https://github.com/postcss/postcss\n"
|
|
50
|
+
}
|