gulp-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 +1 -7
- package/lib/gulp-purgecss.d.ts +4 -0
- package/lib/gulp-purgecss.esm.d.ts +4 -0
- package/lib/gulp-purgecss.esm.js +1 -1
- package/lib/gulp-purgecss.js +1 -1
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
# gulp-purgecss
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/FullHuman/gulp-purgecss)
|
|
4
|
-
[]()
|
|
5
|
-
[]()
|
|
6
|
-
[]()
|
|
7
|
-
[](https://www.codacy.com/app/FullHuman/gulp-purgecss?utm_source=github.com&utm_medium=referral&utm_content=FullHuman/gulp-purgecss&utm_campaign=Badge_Grade)
|
|
8
|
-
[](https://github.com/prettier/prettier)
|
|
9
3
|
[](https://www.npmjs.com/package/gulp-purgecss)
|
|
10
|
-
[]()
|
|
4
|
+
[]()
|
|
11
5
|
|
|
12
6
|
|
|
13
7
|
> [gulp](http://gulpjs.com/) plugin to removed unused CSS, using [purgecss](https://github.com/FullHuman/purgecss)
|
package/lib/gulp-purgecss.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface RawContent<T = string> {
|
|
|
5
5
|
}
|
|
6
6
|
interface RawCSS {
|
|
7
7
|
raw: string;
|
|
8
|
+
name?: string;
|
|
8
9
|
}
|
|
9
10
|
interface ExtractorResultDetailed {
|
|
10
11
|
attributes: {
|
|
@@ -40,11 +41,14 @@ interface UserDefinedOptions {
|
|
|
40
41
|
keyframes?: boolean;
|
|
41
42
|
output?: string;
|
|
42
43
|
rejected?: boolean;
|
|
44
|
+
rejectedCss?: boolean;
|
|
43
45
|
stdin?: boolean;
|
|
44
46
|
stdout?: boolean;
|
|
45
47
|
variables?: boolean;
|
|
46
48
|
safelist?: UserDefinedSafelist;
|
|
47
49
|
blocklist?: StringRegExpArray;
|
|
50
|
+
skippedContentGlobs?: Array<string>;
|
|
51
|
+
dynamicAttributes?: string[];
|
|
48
52
|
}
|
|
49
53
|
type PurgeCSSUserDefinedOptions = UserDefinedOptions;
|
|
50
54
|
interface UserDefinedOptions$0 extends Omit<PurgeCSSUserDefinedOptions, "css" | "content"> {
|
|
@@ -5,6 +5,7 @@ interface RawContent<T = string> {
|
|
|
5
5
|
}
|
|
6
6
|
interface RawCSS {
|
|
7
7
|
raw: string;
|
|
8
|
+
name?: string;
|
|
8
9
|
}
|
|
9
10
|
interface ExtractorResultDetailed {
|
|
10
11
|
attributes: {
|
|
@@ -40,11 +41,14 @@ interface UserDefinedOptions {
|
|
|
40
41
|
keyframes?: boolean;
|
|
41
42
|
output?: string;
|
|
42
43
|
rejected?: boolean;
|
|
44
|
+
rejectedCss?: boolean;
|
|
43
45
|
stdin?: boolean;
|
|
44
46
|
stdout?: boolean;
|
|
45
47
|
variables?: boolean;
|
|
46
48
|
safelist?: UserDefinedSafelist;
|
|
47
49
|
blocklist?: StringRegExpArray;
|
|
50
|
+
skippedContentGlobs?: Array<string>;
|
|
51
|
+
dynamicAttributes?: string[];
|
|
48
52
|
}
|
|
49
53
|
type PurgeCSSUserDefinedOptions = UserDefinedOptions;
|
|
50
54
|
interface UserDefinedOptions$0 extends Omit<PurgeCSSUserDefinedOptions, "css" | "content"> {
|
package/lib/gulp-purgecss.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"
|
|
1
|
+
import e from"glob";import t from"plugin-error";import r from"purgecss";import n from"through2";function o(o){return n.obj((async function(s,c,i){if(s.isNull())return i(null,s);if(s.isBuffer())try{const t={...o,content:(u=o.content,u.reduce(((t,r)=>[...t,...e.sync(r)]),[])),css:[{raw:s.contents.toString()}],stdin:!0},n=(await(new r).purge(t))[0],c=t.rejected&&n.rejected?n.rejected.join(" {}\n")+" {}":n.css;s.contents=Buffer.from(c,"utf-8"),i(null,s)}catch(e){e instanceof Error&&this.emit("error",new t("gulp-purgecss",e.message))}var u;if(s.isStream()){let e="";s.contents.on("data",(t=>{e+=t.toString()})).on("end",(async()=>{try{const t={...o,css:[{raw:e}]},c=(await(new r).purge(t))[0],u=t.rejected&&c.rejected?c.rejected.join(" {}\n")+" {}":c.css,f=n();f.write(Buffer.from(u,"utf-8")),s.contents=s.contents.pipe(f),i(null,s)}catch(e){e instanceof Error&&this.emit("error",new t("gulp-purgecss",e.message))}}))}}))}export{o as default};
|
package/lib/gulp-purgecss.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("
|
|
1
|
+
"use strict";var e=require("glob"),t=require("plugin-error"),r=require("purgecss"),n=require("through2");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(e),c=u(t),o=u(r),i=u(n);module.exports=function(e){return i.default.obj((async function(t,r,n){if(t.isNull())return n(null,t);if(t.isBuffer())try{const r={...e,content:(u=e.content,u.reduce(((e,t)=>[...e,...s.default.sync(t)]),[])),css:[{raw:t.contents.toString()}],stdin:!0},c=(await(new o.default).purge(r))[0],i=r.rejected&&c.rejected?c.rejected.join(" {}\n")+" {}":c.css;t.contents=Buffer.from(i,"utf-8"),n(null,t)}catch(e){e instanceof Error&&this.emit("error",new c.default("gulp-purgecss",e.message))}var u;if(t.isStream()){let r="";t.contents.on("data",(e=>{r+=e.toString()})).on("end",(async()=>{try{const u={...e,css:[{raw:r}]},s=(await(new o.default).purge(u))[0],c=u.rejected&&s.rejected?s.rejected.join(" {}\n")+" {}":s.css,a=i.default();a.write(Buffer.from(c,"utf-8")),t.contents=t.contents.pipe(a),n(null,t)}catch(e){e instanceof Error&&this.emit("error",new c.default("gulp-purgecss",e.message))}}))}}))};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gulp-purgecss",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "Gulp plugin for purgecss",
|
|
5
5
|
"author": "Ffloriel",
|
|
6
6
|
"homepage": "https://purgecss.com",
|
|
@@ -37,16 +37,22 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"glob": "^7.1.6",
|
|
39
39
|
"plugin-error": "^1.0.1",
|
|
40
|
-
"purgecss": "^4.
|
|
40
|
+
"purgecss": "^4.1.2",
|
|
41
41
|
"through2": "^4.0.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"@types/event-stream": "^4.0.0",
|
|
44
45
|
"@types/through2": "^2.0.34",
|
|
45
46
|
"@types/vinyl": "^2.0.4",
|
|
47
|
+
"event-stream": "^4.0.1",
|
|
46
48
|
"vinyl": "^2.2.0"
|
|
47
49
|
},
|
|
48
50
|
"bugs": {
|
|
49
51
|
"url": "https://github.com/FullHuman/purgecss/issues"
|
|
50
52
|
},
|
|
51
|
-
"
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public",
|
|
55
|
+
"registry": "https://registry.npmjs.org/"
|
|
56
|
+
},
|
|
57
|
+
"gitHead": "1329d96b0ad17e9b2b4d604d1a689856da176a59"
|
|
52
58
|
}
|