@fullhuman/postcss-purgecss 4.0.2 → 4.1.2
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/README.md
CHANGED
|
@@ -94,6 +94,15 @@ blocklist: ['usedClass', /^nav-/]
|
|
|
94
94
|
```
|
|
95
95
|
Even if nav-links and usedClass are found by an extractor, they will be removed.
|
|
96
96
|
|
|
97
|
+
### `skippedContentGlobs`
|
|
98
|
+
|
|
99
|
+
If you provide globs for the `content` parameter, you can use this option to exclude certain files or folders that would otherwise be scanned. Pass an array of globs matching items that should be excluded. (Note: this option has no effect if `content` is not globs.)
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
skippedContentGlobs: ['node_modules/**', 'components/**']
|
|
103
|
+
```
|
|
104
|
+
Here, PurgeCSS will not scan anything in the "node_modules" and "components" folders.
|
|
105
|
+
|
|
97
106
|
|
|
98
107
|
### `rejected`
|
|
99
108
|
Type: `boolean`
|
|
@@ -31,6 +31,8 @@ interface UserDefinedOptions$0 {
|
|
|
31
31
|
variables?: boolean;
|
|
32
32
|
safelist?: UserDefinedSafelist;
|
|
33
33
|
blocklist?: StringRegExpArray;
|
|
34
|
+
skippedContentGlobs?: Array<string>;
|
|
35
|
+
dynamicAttributes?: string[];
|
|
34
36
|
}
|
|
35
37
|
declare const purgeCSSPlugin: postcss.PluginCreator<UserDefinedOptions$0>;
|
|
36
38
|
export { purgeCSSPlugin as default };
|
|
@@ -31,6 +31,8 @@ interface UserDefinedOptions$0 {
|
|
|
31
31
|
variables?: boolean;
|
|
32
32
|
safelist?: UserDefinedSafelist;
|
|
33
33
|
blocklist?: StringRegExpArray;
|
|
34
|
+
skippedContentGlobs?: Array<string>;
|
|
35
|
+
dynamicAttributes?: string[];
|
|
34
36
|
}
|
|
35
37
|
declare const purgeCSSPlugin: postcss.PluginCreator<UserDefinedOptions$0>;
|
|
36
38
|
export { purgeCSSPlugin as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{defaultOptions as t,standardizeSafelist as s,mergeExtractorSelectors as o}from"purgecss";const r=function(r){if(void 0===r)throw new Error("PurgeCSS plugin does not have the correct options");return{postcssPlugin:"postcss-purgecss",
|
|
1
|
+
import e,{defaultOptions as t,standardizeSafelist as s,mergeExtractorSelectors as o}from"purgecss";const r=function(r){if(void 0===r)throw new Error("PurgeCSS plugin does not have the correct options");return{postcssPlugin:"postcss-purgecss",OnceExit:(n,c)=>async function(r,n,{result:c}){const i=new e,a={...t,...r,safelist:s(null==r?void 0:r.safelist)};r&&"function"==typeof r.contentFunction&&(a.content=r.contentFunction(n.source&&n.source.input.file||"")),i.options=a;const{content:p,extractors:u}=a,l=p.filter((e=>"string"==typeof e)),f=p.filter((e=>"object"==typeof e)),m=await i.extractSelectorsFromFiles(l,u),g=await i.extractSelectorsFromString(f,u),d=o(m,g);i.walkThroughCSS(n,d),i.options.fontFace&&i.removeUnusedFontFaces(),i.options.keyframes&&i.removeUnusedKeyframes(),i.options.variables&&i.removeUnusedCSSVariables(),i.options.rejected&&i.selectorsRemoved.size>0&&(c.messages.push({type:"purgecss",plugin:"postcss-purgecss",text:`purging ${i.selectorsRemoved.size} selectors:\n ${Array.from(i.selectorsRemoved).map((e=>e.trim())).join("\n ")}`}),i.selectorsRemoved.clear())}(r,n,c)}};r.postcss=!0;export{r as default};
|
package/lib/postcss-purgecss.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("purgecss");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(e);const o=function(t){if(void 0===t)throw new Error("PurgeCSS plugin does not have the correct options");return{postcssPlugin:"postcss-purgecss",
|
|
1
|
+
"use strict";var e=require("purgecss");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(e);const o=function(t){if(void 0===t)throw new Error("PurgeCSS plugin does not have the correct options");return{postcssPlugin:"postcss-purgecss",OnceExit:(o,r)=>async function(t,o,{result:r}){const n=new s.default,c={...e.defaultOptions,...t,safelist:e.standardizeSafelist(null==t?void 0:t.safelist)};t&&"function"==typeof t.contentFunction&&(c.content=t.contentFunction(o.source&&o.source.input.file||"")),n.options=c;const{content:i,extractors:a}=c,u=i.filter((e=>"string"==typeof e)),l=i.filter((e=>"object"==typeof e)),p=await n.extractSelectorsFromFiles(u,a),f=await n.extractSelectorsFromString(l,a),d=e.mergeExtractorSelectors(p,f);n.walkThroughCSS(o,d),n.options.fontFace&&n.removeUnusedFontFaces(),n.options.keyframes&&n.removeUnusedKeyframes(),n.options.variables&&n.removeUnusedCSSVariables(),n.options.rejected&&n.selectorsRemoved.size>0&&(r.messages.push({type:"purgecss",plugin:"postcss-purgecss",text:`purging ${n.selectorsRemoved.size} selectors:\n ${Array.from(n.selectorsRemoved).map((e=>e.trim())).join("\n ")}`}),n.selectorsRemoved.clear())}(t,o,r)}};o.postcss=!0,module.exports=o;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullhuman/postcss-purgecss",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "PostCSS plugin for PurgeCSS",
|
|
5
5
|
"author": "FoundrySH <no-reply@foundry.sh>",
|
|
6
6
|
"homepage": "https://purgecss.com",
|
|
@@ -26,13 +26,17 @@
|
|
|
26
26
|
"url": "https://github.com/FullHuman/purgecss/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"purgecss": "^4.
|
|
29
|
+
"purgecss": "^4.1.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"postcss": "^8.
|
|
32
|
+
"postcss": "^8.3.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"postcss": "^8.0.0"
|
|
36
36
|
},
|
|
37
|
-
"
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"registry": "https://registry.npmjs.org/"
|
|
40
|
+
},
|
|
41
|
+
"gitHead": "1329d96b0ad17e9b2b4d604d1a689856da176a59"
|
|
38
42
|
}
|