@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
@@ -12,7 +12,7 @@
12
12
  ## Installation
13
13
 
14
14
  ```
15
- npm i -D @fullhuman/postcss-purgecss
15
+ npm i -D @fullhuman/postcss-purgecss postcss
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -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 purgeCSSPlugin: postcss.Plugin<Pick<UserDefinedOptions$0, "variables" | "keyframes" | "content" | "extractors" | "safelist" | "contentFunction" | "defaultExtractor" | "fontFace" | "output" | "rejected" | "stdin" | "stdout" | "blocklist">>;
36
- export { purgeCSSPlugin as default };
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 purgeCSSPlugin: postcss.Plugin<Pick<UserDefinedOptions$0, "variables" | "keyframes" | "content" | "extractors" | "safelist" | "contentFunction" | "defaultExtractor" | "fontFace" | "output" | "rejected" | "stdin" | "stdout" | "blocklist">>;
36
- export { purgeCSSPlugin as default };
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 t,{defaultOptions as s,standardizeSafelist as o,mergeExtractorSelectors as n}from"purgecss";const r=e.plugin("postcss-plugin-purgecss",(function(e){return async function(r,c){const i=new t,p={...s,...e,safelist:o(null==e?void 0:e.safelist)};e&&"function"==typeof e.contentFunction&&(p.content=e.contentFunction(r.source&&r.source.input.file||"")),i.options=p;const{content:a,extractors:u}=p,l=a.filter(e=>"string"==typeof e),m=a.filter(e=>"object"==typeof e),f=await i.extractSelectorsFromFiles(l,u),g=await i.extractSelectorsFromString(m,u),d=n(f,g);i.walkThroughCSS(r,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())}}));export default r;
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;
@@ -1 +1 @@
1
- "use strict";var e=require("postcss"),t=require("purgecss");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=s(e),r=s(t);const n=o.default.plugin("postcss-plugin-purgecss",(function(e){return async function(s,o){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(s.source&&s.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=t.mergeExtractorSelectors(p,f);n.walkThroughCSS(s,d),n.options.fontFace&&n.removeUnusedFontFaces(),n.options.keyframes&&n.removeUnusedKeyframes(),n.options.variables&&n.removeUnusedCSSVariables(),n.options.rejected&&n.selectorsRemoved.size>0&&(o.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())}}));module.exports=n;
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.0.0",
3
+ "version": "3.1.3",
4
4
  "description": "PostCSS plugin for PurgeCSS",
5
5
  "author": "FoundrySH <no-reply@foundry.sh>",
6
- "homepage": "https://github.com/FullHuman/purgecss#readme",
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
- "postcss": "7.0.32",
30
- "purgecss": "^3.0.0"
29
+ "purgecss": "^3.1.3"
31
30
  },
32
- "gitHead": "4a2a9504a41fe361f5aa36f3a2e50eabee84aec0"
31
+ "devDependencies": {
32
+ "postcss": "^8.2.1",
33
+ "postcss7": "npm:postcss@7.0.34"
34
+ },
35
+ "gitHead": "6ea98b62c81adf60acb224a6b248f4f806efbdaf"
33
36
  }