rollup-plugin-purgecss 4.0.1 → 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.
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
import { Plugin } from "rollup";
|
|
2
2
|
type StringRegExpArray = Array<RegExp | string>;
|
|
3
3
|
type ComplexSafelist = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
standard?: StringRegExpArray;
|
|
5
|
+
deep?: RegExp[];
|
|
6
|
+
greedy?: RegExp[];
|
|
7
|
+
variables?: StringRegExpArray;
|
|
8
|
+
keyframes?: StringRegExpArray;
|
|
9
9
|
};
|
|
10
10
|
type UserDefinedSafelist = StringRegExpArray | ComplexSafelist;
|
|
11
11
|
interface RawContent$0<T = string> {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
extension: string;
|
|
13
|
+
raw: T;
|
|
14
14
|
}
|
|
15
15
|
type ExtractorFunction$0<T = string> = (content: T) => string[];
|
|
16
16
|
interface Extractors$0 {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
extensions: string[];
|
|
18
|
+
extractor: ExtractorFunction$0;
|
|
19
19
|
}
|
|
20
20
|
type OutputFunction = (css: string, styles: string[]) => void;
|
|
21
21
|
interface UserDefinedOptions$0 {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
content: Array<string | RawContent$0>;
|
|
23
|
+
contentFunction?: (sourceFile: string) => Array<string | RawContent$0>;
|
|
24
|
+
defaultExtractor?: ExtractorFunction$0;
|
|
25
|
+
extractors?: Array<Extractors$0>;
|
|
26
|
+
fontFace?: boolean;
|
|
27
|
+
keyframes?: boolean;
|
|
28
|
+
output?: string | OutputFunction | boolean;
|
|
29
|
+
rejected?: boolean;
|
|
30
|
+
stdin?: boolean;
|
|
31
|
+
stdout?: boolean;
|
|
32
|
+
variables?: boolean;
|
|
33
|
+
safelist?: UserDefinedSafelist;
|
|
34
|
+
blocklist?: StringRegExpArray;
|
|
35
|
+
skippedContentGlobs?: Array<string>;
|
|
36
|
+
dynamicAttributes?: string[];
|
|
37
|
+
insert?: boolean;
|
|
38
|
+
include?: string | RegExp | (string | RegExp)[];
|
|
39
|
+
exclude?: string | RegExp | (string | RegExp)[];
|
|
40
|
+
dest?: string;
|
|
39
41
|
}
|
|
40
42
|
declare function pluginPurgeCSS(options: UserDefinedOptions$0): Plugin;
|
|
41
43
|
export { pluginPurgeCSS as default };
|
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
import { Plugin } from "rollup";
|
|
2
2
|
type StringRegExpArray = Array<RegExp | string>;
|
|
3
3
|
type ComplexSafelist = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
standard?: StringRegExpArray;
|
|
5
|
+
deep?: RegExp[];
|
|
6
|
+
greedy?: RegExp[];
|
|
7
|
+
variables?: StringRegExpArray;
|
|
8
|
+
keyframes?: StringRegExpArray;
|
|
9
9
|
};
|
|
10
10
|
type UserDefinedSafelist = StringRegExpArray | ComplexSafelist;
|
|
11
11
|
interface RawContent$0<T = string> {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
extension: string;
|
|
13
|
+
raw: T;
|
|
14
14
|
}
|
|
15
15
|
type ExtractorFunction$0<T = string> = (content: T) => string[];
|
|
16
16
|
interface Extractors$0 {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
extensions: string[];
|
|
18
|
+
extractor: ExtractorFunction$0;
|
|
19
19
|
}
|
|
20
20
|
type OutputFunction = (css: string, styles: string[]) => void;
|
|
21
21
|
interface UserDefinedOptions$0 {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
content: Array<string | RawContent$0>;
|
|
23
|
+
contentFunction?: (sourceFile: string) => Array<string | RawContent$0>;
|
|
24
|
+
defaultExtractor?: ExtractorFunction$0;
|
|
25
|
+
extractors?: Array<Extractors$0>;
|
|
26
|
+
fontFace?: boolean;
|
|
27
|
+
keyframes?: boolean;
|
|
28
|
+
output?: string | OutputFunction | boolean;
|
|
29
|
+
rejected?: boolean;
|
|
30
|
+
stdin?: boolean;
|
|
31
|
+
stdout?: boolean;
|
|
32
|
+
variables?: boolean;
|
|
33
|
+
safelist?: UserDefinedSafelist;
|
|
34
|
+
blocklist?: StringRegExpArray;
|
|
35
|
+
skippedContentGlobs?: Array<string>;
|
|
36
|
+
dynamicAttributes?: string[];
|
|
37
|
+
insert?: boolean;
|
|
38
|
+
include?: string | RegExp | (string | RegExp)[];
|
|
39
|
+
exclude?: string | RegExp | (string | RegExp)[];
|
|
40
|
+
dest?: string;
|
|
39
41
|
}
|
|
40
42
|
declare function pluginPurgeCSS(options: UserDefinedOptions$0): Plugin;
|
|
41
43
|
export { pluginPurgeCSS as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"fs";import{PurgeCSS as e}from"purgecss";import{createFilter as n}from"rollup-pluginutils";function r(r){const u=n(r.include||["**/*.css"],r.exclude||"node_modules/**"),s=[];let o="";return{name:"purgecss",transform:async(t,n)=>{if(!u(n))return null;let o=(await(new e).purge({content:r.content,css:[{raw:t}]}))[0].css;return s.push(o),o=JSON.stringify(o),r.insert||(t=r.output?'"";':o),{code
|
|
1
|
+
import t from"fs";import{PurgeCSS as e}from"purgecss";import{createFilter as n}from"rollup-pluginutils";function r(r){const u=n(r.include||["**/*.css"],r.exclude||"node_modules/**"),s=[];let o="";return{name:"purgecss",transform:async(t,n)=>{if(!u(n))return null;let o=(await(new e).purge({content:r.content,css:[{raw:t}]}))[0].css;return s.push(o),o=JSON.stringify(o),r.insert||(t=r.output?'"";':o),{code:`export default ${t}`,map:{mappings:""}}},generateBundle(){if(!(r.insert||s.length&&!1!==r.output))return;const e=s.reduce(((t,e)=>t+e),"");return"string"==typeof r.output?t.writeFileSync(r.output,e):"function"==typeof r.output?r.output(e,s):!r.insert&&o?((o.endsWith(".js")||o.endsWith(".ts"))&&(o=o.slice(0,-3)),o=`${o}.css`,t.writeFileSync(o,e)):void 0}}}export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("fs"),t=require("purgecss"),u=require("rollup-pluginutils");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e);module.exports=function(e){const r=u.createFilter(e.include||["**/*.css"],e.exclude||"node_modules/**"),s=[];let i="";return{name:"purgecss",transform:async(u,n)=>{if(!r(n))return null;let i=(await(new t.PurgeCSS).purge({content:e.content,css:[{raw:u}]}))[0].css;return s.push(i),i=JSON.stringify(i),e.insert||(u=e.output?'"";':i),{code
|
|
1
|
+
"use strict";var e=require("fs"),t=require("purgecss"),u=require("rollup-pluginutils");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e);module.exports=function(e){const r=u.createFilter(e.include||["**/*.css"],e.exclude||"node_modules/**"),s=[];let i="";return{name:"purgecss",transform:async(u,n)=>{if(!r(n))return null;let i=(await(new t.PurgeCSS).purge({content:e.content,css:[{raw:u}]}))[0].css;return s.push(i),i=JSON.stringify(i),e.insert||(u=e.output?'"";':i),{code:`export default ${u}`,map:{mappings:""}}},generateBundle(){if(!(e.insert||s.length&&!1!==e.output))return;const t=s.reduce(((e,t)=>e+t),"");return"string"==typeof e.output?n.default.writeFileSync(e.output,t):"function"==typeof e.output?e.output(t,s):!e.insert&&i?((i.endsWith(".js")||i.endsWith(".ts"))&&(i=i.slice(0,-3)),i=`${i}.css`,n.default.writeFileSync(i,t)):void 0}}};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-purgecss",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "Rollup plugin for purgecss",
|
|
5
5
|
"main": "lib/rollup-plugin-purgecss.js",
|
|
6
6
|
"module": "./lib/rollup-plugin-purgecss.es.js",
|
|
@@ -10,13 +10,11 @@
|
|
|
10
10
|
"test": "__tests__"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"
|
|
14
|
-
"test": "npx ava __tests__/index.test.js -s",
|
|
15
|
-
"lint": "npx eslint -c .eslintrc src/"
|
|
13
|
+
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
16
14
|
},
|
|
17
15
|
"repository": {
|
|
18
16
|
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/FullHuman/
|
|
17
|
+
"url": "git+https://github.com/FullHuman/purgecss.git"
|
|
20
18
|
},
|
|
21
19
|
"keywords": [
|
|
22
20
|
"rollup-plugin",
|
|
@@ -28,12 +26,16 @@
|
|
|
28
26
|
"author": "Ffloriel",
|
|
29
27
|
"license": "MIT",
|
|
30
28
|
"bugs": {
|
|
31
|
-
"url": "https://github.com/FullHuman/
|
|
29
|
+
"url": "https://github.com/FullHuman/purgecss/issues"
|
|
32
30
|
},
|
|
33
|
-
"homepage": "https://
|
|
31
|
+
"homepage": "https://purgecss.com",
|
|
34
32
|
"dependencies": {
|
|
35
|
-
"purgecss": "^4.
|
|
33
|
+
"purgecss": "^4.1.2",
|
|
36
34
|
"rollup-pluginutils": "^2.8.0"
|
|
37
35
|
},
|
|
38
|
-
"
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public",
|
|
38
|
+
"registry": "https://registry.npmjs.org/"
|
|
39
|
+
},
|
|
40
|
+
"gitHead": "1329d96b0ad17e9b2b4d604d1a689856da176a59"
|
|
39
41
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -32,6 +32,8 @@ export interface UserDefinedOptions {
|
|
|
32
32
|
variables?: boolean;
|
|
33
33
|
safelist?: UserDefinedSafelist;
|
|
34
34
|
blocklist?: StringRegExpArray;
|
|
35
|
+
skippedContentGlobs?: Array<string>;
|
|
36
|
+
dynamicAttributes?: string[];
|
|
35
37
|
|
|
36
38
|
insert?: boolean;
|
|
37
39
|
include?: string | RegExp | (string | RegExp)[];
|