@fullhuman/postcss-purgecss 3.0.0 → 3.1.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/README.md
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import postcss from "postcss";
|
|
2
1
|
type StringRegExpArray = Array<RegExp | string>;
|
|
3
2
|
type ComplexSafelist = {
|
|
4
3
|
standard?: StringRegExpArray;
|
|
@@ -32,5 +31,5 @@ interface UserDefinedOptions$0 {
|
|
|
32
31
|
safelist?: UserDefinedSafelist;
|
|
33
32
|
blocklist?: StringRegExpArray;
|
|
34
33
|
}
|
|
35
|
-
declare const
|
|
36
|
-
export {
|
|
34
|
+
declare const _default: import("postcss").PluginCreator<UserDefinedOptions$0> | import("postcss7").Plugin<UserDefinedOptions$0>;
|
|
35
|
+
export { _default as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import postcss from "postcss";
|
|
2
1
|
type StringRegExpArray = Array<RegExp | string>;
|
|
3
2
|
type ComplexSafelist = {
|
|
4
3
|
standard?: StringRegExpArray;
|
|
@@ -32,5 +31,5 @@ interface UserDefinedOptions$0 {
|
|
|
32
31
|
safelist?: UserDefinedSafelist;
|
|
33
32
|
blocklist?: StringRegExpArray;
|
|
34
33
|
}
|
|
35
|
-
declare const
|
|
36
|
-
export {
|
|
34
|
+
declare const _default: import("postcss").PluginCreator<UserDefinedOptions$0> | import("postcss7").Plugin<UserDefinedOptions$0>;
|
|
35
|
+
export { _default as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"postcss";import
|
|
1
|
+
import e from"postcss";import o,{defaultOptions as t,standardizeSafelist as s,mergeExtractorSelectors as r}from"purgecss";async function n(e,n,{result:c}){const i=new o,u={...t,...e,safelist:s(null==e?void 0:e.safelist)};e&&"function"==typeof e.contentFunction&&(u.content=e.contentFunction(n.source&&n.source.input.file||"")),i.options=u;const{content:p,extractors:a}=u,l=p.filter((e=>"string"==typeof e)),f=p.filter((e=>"object"==typeof e)),m=await i.extractSelectorsFromFiles(l,a),g=await i.extractSelectorsFromString(f,a),d=r(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())}const c=function(e){if(void 0===e)throw new Error("PurgeCSS plugin does not have the correct options");return{postcssPlugin:"postcss-purgecss",Once:(o,t)=>n(e,o,t)}};c.postcss=!0;var i,u=function(e){return void 0!==e.Root}(i=e)?c:i.plugin("postcss-purgecss",(e=>{if(void 0===e)throw new Error("PurgeCSS plugin does not have the correct options");return async function(o,t){return n(e,o,t)}}));export default u;
|
package/lib/postcss-purgecss.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("postcss"),t=require("purgecss");function
|
|
1
|
+
"use strict";var e=require("postcss"),t=require("purgecss");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),r=o(t);async function n(e,o,{result:s}){const n=new r.default,c={...t.defaultOptions,...e,safelist:t.standardizeSafelist(null==e?void 0:e.safelist)};e&&"function"==typeof e.contentFunction&&(c.content=e.contentFunction(o.source&&o.source.input.file||"")),n.options=c;const{content:i,extractors:u}=c,a=i.filter((e=>"string"==typeof e)),l=i.filter((e=>"object"==typeof e)),p=await n.extractSelectorsFromFiles(a,u),f=await n.extractSelectorsFromString(l,u),d=t.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&&(s.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())}const c=function(e){if(void 0===e)throw new Error("PurgeCSS plugin does not have the correct options");return{postcssPlugin:"postcss-purgecss",Once:(t,o)=>n(e,t,o)}};c.postcss=!0;var i,u=function(e){return void 0!==e.Root}(i=s.default)?c:i.plugin("postcss-purgecss",(e=>{if(void 0===e)throw new Error("PurgeCSS plugin does not have the correct options");return async function(t,o){return n(e,t,o)}}));module.exports=u;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullhuman/postcss-purgecss",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "PostCSS plugin for PurgeCSS",
|
|
5
5
|
"author": "FoundrySH <no-reply@foundry.sh>",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://purgecss.com",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "lib/postcss-purgecss.js",
|
|
9
9
|
"module": "lib/postcss-purgecss.esm.js",
|
|
@@ -26,8 +26,11 @@
|
|
|
26
26
|
"url": "https://github.com/FullHuman/purgecss/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"
|
|
30
|
-
"purgecss": "^3.0.0"
|
|
29
|
+
"purgecss": "^3.1.3"
|
|
31
30
|
},
|
|
32
|
-
"
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"postcss": "^8.2.1",
|
|
33
|
+
"postcss7": "npm:postcss@7.0.34"
|
|
34
|
+
},
|
|
35
|
+
"gitHead": "6ea98b62c81adf60acb224a6b248f4f806efbdaf"
|
|
33
36
|
}
|