@node-minify/clean-css 8.0.0-beta.0 → 8.0.2-beta.0
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/dist/index.d.ts +4 -8
- package/dist/index.js +4 -13
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +34 -25
- package/dist/index.mjs.map +1 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -6,13 +6,9 @@ import { MinifierOptions } from '@node-minify/types';
|
|
|
6
6
|
* MIT Licensed
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* @param {String} content
|
|
14
|
-
* @param {Function} callback
|
|
15
|
-
*/
|
|
16
|
-
declare const minifyCleanCSS: ({ settings, content, callback, index }: MinifierOptions) => any;
|
|
9
|
+
declare const minifyCleanCSS: {
|
|
10
|
+
({ settings, content, callback, index }: MinifierOptions): any;
|
|
11
|
+
default: any;
|
|
12
|
+
};
|
|
17
13
|
|
|
18
14
|
export { minifyCleanCSS as default };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
8
|
var __copyProps = (to, from, except, desc) => {
|
|
12
9
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
10
|
for (let key of __getOwnPropNames(from))
|
|
@@ -20,14 +17,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
17
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
18
|
mod
|
|
22
19
|
));
|
|
23
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
20
|
|
|
25
21
|
// src/index.ts
|
|
26
|
-
var src_exports = {};
|
|
27
|
-
__export(src_exports, {
|
|
28
|
-
default: () => src_default
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(src_exports);
|
|
31
22
|
var import_clean_css = __toESM(require("clean-css"));
|
|
32
23
|
var import_utils = require("@node-minify/utils");
|
|
33
24
|
var minifyCleanCSS = ({ settings, content, callback, index }) => {
|
|
@@ -52,11 +43,11 @@ var minifyCleanCSS = ({ settings, content, callback, index }) => {
|
|
|
52
43
|
}
|
|
53
44
|
return contentMinified;
|
|
54
45
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
0 && (module.exports = {});
|
|
46
|
+
minifyCleanCSS.default = minifyCleanCSS;
|
|
47
|
+
module.exports = minifyCleanCSS;
|
|
58
48
|
/*!
|
|
59
49
|
* node-minify
|
|
60
50
|
* Copyright(c) 2011-2022 Rodolphe Stoclin
|
|
61
51
|
* MIT Licensed
|
|
62
52
|
*/
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport CleanCSS from 'clean-css';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n/**\n * Run clean-css.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyCleanCSS = ({ settings, content, callback, index }: MinifierOptions) => {\n if (settings && settings.options && settings.options.sourceMap) {\n settings.options._sourceMap = settings.options.sourceMap;\n settings.options.sourceMap = true;\n }\n const _cleanCSS = new CleanCSS(settings && settings.options).minify(content || '');\n const contentMinified = _cleanCSS.styles;\n if (_cleanCSS.sourceMap && settings && settings.options && settings.options._sourceMap) {\n utils.writeFile({\n file:\n settings.options._sourceMap !== true && settings.options._sourceMap.url\n ? settings.options._sourceMap.url\n : null,\n content: _cleanCSS.sourceMap.toString(),\n index\n });\n }\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content: contentMinified, index });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifyCleanCSS()`.\n */\nminifyCleanCSS.default = minifyCleanCSS;\nexport = minifyCleanCSS;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,uBAAqB;AACrB,mBAAsB;AAUtB,IAAM,iBAAiB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AAClF,MAAI,YAAY,SAAS,WAAW,SAAS,QAAQ,WAAW;AAC9D,aAAS,QAAQ,aAAa,SAAS,QAAQ;AAC/C,aAAS,QAAQ,YAAY;AAAA,EAC/B;AACA,QAAM,YAAY,IAAI,iBAAAA,QAAS,YAAY,SAAS,OAAO,EAAE,OAAO,WAAW,EAAE;AACjF,QAAM,kBAAkB,UAAU;AAClC,MAAI,UAAU,aAAa,YAAY,SAAS,WAAW,SAAS,QAAQ,YAAY;AACtF,uBAAM,UAAU;AAAA,MACd,MACE,SAAS,QAAQ,eAAe,QAAQ,SAAS,QAAQ,WAAW,MAChE,SAAS,QAAQ,WAAW,MAC5B;AAAA,MACN,SAAS,UAAU,UAAU,SAAS;AAAA,MACtC;AAAA,IACF,CAAC;AAAA,EACH;AACA,MAAI,YAAY,CAAC,SAAS,SAAS;AACjC,uBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,iBAAiB,MAAM,CAAC;AAAA,EAC5E;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,eAAe;AAAA,EACvC;AACA,SAAO;AACT;AAKA,eAAe,UAAU;AACzB,iBAAS;","names":["CleanCSS"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,34 +1,43 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
+
};
|
|
5
|
+
|
|
1
6
|
// src/index.ts
|
|
2
7
|
import CleanCSS from "clean-css";
|
|
3
8
|
import { utils } from "@node-minify/utils";
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
var require_src = __commonJS({
|
|
10
|
+
"src/index.ts"(exports, module) {
|
|
11
|
+
var minifyCleanCSS = ({ settings, content, callback, index }) => {
|
|
12
|
+
if (settings && settings.options && settings.options.sourceMap) {
|
|
13
|
+
settings.options._sourceMap = settings.options.sourceMap;
|
|
14
|
+
settings.options.sourceMap = true;
|
|
15
|
+
}
|
|
16
|
+
const _cleanCSS = new CleanCSS(settings && settings.options).minify(content || "");
|
|
17
|
+
const contentMinified = _cleanCSS.styles;
|
|
18
|
+
if (_cleanCSS.sourceMap && settings && settings.options && settings.options._sourceMap) {
|
|
19
|
+
utils.writeFile({
|
|
20
|
+
file: settings.options._sourceMap !== true && settings.options._sourceMap.url ? settings.options._sourceMap.url : null,
|
|
21
|
+
content: _cleanCSS.sourceMap.toString(),
|
|
22
|
+
index
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
if (settings && !settings.content) {
|
|
26
|
+
utils.writeFile({ file: settings.output, content: contentMinified, index });
|
|
27
|
+
}
|
|
28
|
+
if (callback) {
|
|
29
|
+
return callback(null, contentMinified);
|
|
30
|
+
}
|
|
31
|
+
return contentMinified;
|
|
32
|
+
};
|
|
33
|
+
minifyCleanCSS.default = minifyCleanCSS;
|
|
34
|
+
module.exports = minifyCleanCSS;
|
|
20
35
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return contentMinified;
|
|
25
|
-
};
|
|
26
|
-
var src_default = minifyCleanCSS;
|
|
27
|
-
export {
|
|
28
|
-
src_default as default
|
|
29
|
-
};
|
|
36
|
+
});
|
|
37
|
+
export default require_src();
|
|
30
38
|
/*!
|
|
31
39
|
* node-minify
|
|
32
40
|
* Copyright(c) 2011-2022 Rodolphe Stoclin
|
|
33
41
|
* MIT Licensed
|
|
34
42
|
*/
|
|
43
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2022 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport CleanCSS from 'clean-css';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n/**\n * Run clean-css.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyCleanCSS = ({ settings, content, callback, index }: MinifierOptions) => {\n if (settings && settings.options && settings.options.sourceMap) {\n settings.options._sourceMap = settings.options.sourceMap;\n settings.options.sourceMap = true;\n }\n const _cleanCSS = new CleanCSS(settings && settings.options).minify(content || '');\n const contentMinified = _cleanCSS.styles;\n if (_cleanCSS.sourceMap && settings && settings.options && settings.options._sourceMap) {\n utils.writeFile({\n file:\n settings.options._sourceMap !== true && settings.options._sourceMap.url\n ? settings.options._sourceMap.url\n : null,\n content: _cleanCSS.sourceMap.toString(),\n index\n });\n }\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content: contentMinified, index });\n }\n if (callback) {\n return callback(null, contentMinified);\n }\n return contentMinified;\n};\n\n/**\n * Expose `minifyCleanCSS()`.\n */\nminifyCleanCSS.default = minifyCleanCSS;\nexport = minifyCleanCSS;\n"],"mappings":";;;;;;AASA,OAAO,cAAc;AACrB,SAAS,aAAa;AAVtB;AAAA;AAoBA,QAAM,iBAAiB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AAClF,UAAI,YAAY,SAAS,WAAW,SAAS,QAAQ,WAAW;AAC9D,iBAAS,QAAQ,aAAa,SAAS,QAAQ;AAC/C,iBAAS,QAAQ,YAAY;AAAA,MAC/B;AACA,YAAM,YAAY,IAAI,SAAS,YAAY,SAAS,OAAO,EAAE,OAAO,WAAW,EAAE;AACjF,YAAM,kBAAkB,UAAU;AAClC,UAAI,UAAU,aAAa,YAAY,SAAS,WAAW,SAAS,QAAQ,YAAY;AACtF,cAAM,UAAU;AAAA,UACd,MACE,SAAS,QAAQ,eAAe,QAAQ,SAAS,QAAQ,WAAW,MAChE,SAAS,QAAQ,WAAW,MAC5B;AAAA,UACN,SAAS,UAAU,UAAU,SAAS;AAAA,UACtC;AAAA,QACF,CAAC;AAAA,MACH;AACA,UAAI,YAAY,CAAC,SAAS,SAAS;AACjC,cAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,iBAAiB,MAAM,CAAC;AAAA,MAC5E;AACA,UAAI,UAAU;AACZ,eAAO,SAAS,MAAM,eAAe;AAAA,MACvC;AACA,aAAO;AAAA,IACT;AAKA,mBAAe,UAAU;AACzB,qBAAS;AAAA;AAAA;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-minify/clean-css",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2-beta.0",
|
|
4
4
|
"description": "clean-css plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"clean": "pnpm dlx rimraf dist",
|
|
44
|
-
"build": "npm run clean && tsup src/index.ts --format cjs,esm --dts --clean",
|
|
44
|
+
"build": "npm run clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
|
|
45
45
|
"prepublishOnly": "npm run build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@node-minify/utils": "8.0.
|
|
48
|
+
"@node-minify/utils": "8.0.2-beta.0",
|
|
49
49
|
"clean-css": "5.3.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@node-minify/types": "8.0.
|
|
52
|
+
"@node-minify/types": "8.0.2-beta.0",
|
|
53
53
|
"@types/clean-css": "^4.2.6"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "bd2fe186257749fcb9bf7a9ff1ce61fb922c4ade"
|
|
56
56
|
}
|