@node-minify/clean-css 8.0.2-beta.0 → 8.0.3-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 +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
14
|
return to;
|
|
15
15
|
};
|
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
22
|
mod
|
|
19
23
|
));
|
|
@@ -28,15 +32,15 @@ var minifyCleanCSS = ({ settings, content, callback, index }) => {
|
|
|
28
32
|
}
|
|
29
33
|
const _cleanCSS = new import_clean_css.default(settings && settings.options).minify(content || "");
|
|
30
34
|
const contentMinified = _cleanCSS.styles;
|
|
31
|
-
if (_cleanCSS.sourceMap && settings && settings.options && settings.options._sourceMap) {
|
|
35
|
+
if (_cleanCSS.sourceMap && settings && settings.options && typeof settings.options._sourceMap === "object") {
|
|
32
36
|
import_utils.utils.writeFile({
|
|
33
|
-
file: settings.options._sourceMap
|
|
37
|
+
file: settings.options._sourceMap.url ? settings.options._sourceMap.url : "",
|
|
34
38
|
content: _cleanCSS.sourceMap.toString(),
|
|
35
39
|
index
|
|
36
40
|
});
|
|
37
41
|
}
|
|
38
|
-
if (settings && !settings.content) {
|
|
39
|
-
import_utils.utils.writeFile({ file: settings.output, content: contentMinified, index });
|
|
42
|
+
if (settings && !settings.content && settings.output) {
|
|
43
|
+
settings.output && import_utils.utils.writeFile({ file: settings.output, content: contentMinified, index });
|
|
40
44
|
}
|
|
41
45
|
if (callback) {
|
|
42
46
|
return callback(null, contentMinified);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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
|
|
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 && typeof settings.options._sourceMap === 'object') {\n utils.writeFile({\n file: settings.options._sourceMap.url ? settings.options._sourceMap.url : '',\n content: _cleanCSS.sourceMap.toString(),\n index\n });\n }\n if (settings && !settings.content && settings.output) {\n settings.output && 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,OAAO,SAAS,QAAQ,eAAe,UAAU;AAC1G,uBAAM,UAAU;AAAA,MACd,MAAM,SAAS,QAAQ,WAAW,MAAM,SAAS,QAAQ,WAAW,MAAM;AAAA,MAC1E,SAAS,UAAU,UAAU,SAAS;AAAA,MACtC;AAAA,IACF,CAAC;AAAA,EACH;AACA,MAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,aAAS,UAAU,mBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,iBAAiB,MAAM,CAAC;AAAA,EAC/F;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
|
@@ -15,15 +15,15 @@ var require_src = __commonJS({
|
|
|
15
15
|
}
|
|
16
16
|
const _cleanCSS = new CleanCSS(settings && settings.options).minify(content || "");
|
|
17
17
|
const contentMinified = _cleanCSS.styles;
|
|
18
|
-
if (_cleanCSS.sourceMap && settings && settings.options && settings.options._sourceMap) {
|
|
18
|
+
if (_cleanCSS.sourceMap && settings && settings.options && typeof settings.options._sourceMap === "object") {
|
|
19
19
|
utils.writeFile({
|
|
20
|
-
file: settings.options._sourceMap
|
|
20
|
+
file: settings.options._sourceMap.url ? settings.options._sourceMap.url : "",
|
|
21
21
|
content: _cleanCSS.sourceMap.toString(),
|
|
22
22
|
index
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
if (settings && !settings.content) {
|
|
26
|
-
utils.writeFile({ file: settings.output, content: contentMinified, index });
|
|
25
|
+
if (settings && !settings.content && settings.output) {
|
|
26
|
+
settings.output && utils.writeFile({ file: settings.output, content: contentMinified, index });
|
|
27
27
|
}
|
|
28
28
|
if (callback) {
|
|
29
29
|
return callback(null, contentMinified);
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +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
|
|
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 && typeof settings.options._sourceMap === 'object') {\n utils.writeFile({\n file: settings.options._sourceMap.url ? settings.options._sourceMap.url : '',\n content: _cleanCSS.sourceMap.toString(),\n index\n });\n }\n if (settings && !settings.content && settings.output) {\n settings.output && 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,OAAO,SAAS,QAAQ,eAAe,UAAU;AAC1G,cAAM,UAAU;AAAA,UACd,MAAM,SAAS,QAAQ,WAAW,MAAM,SAAS,QAAQ,WAAW,MAAM;AAAA,UAC1E,SAAS,UAAU,UAAU,SAAS;AAAA,UACtC;AAAA,QACF,CAAC;AAAA,MACH;AACA,UAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,iBAAS,UAAU,MAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,iBAAiB,MAAM,CAAC;AAAA,MAC/F;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.3-beta.0",
|
|
4
4
|
"description": "clean-css plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"homepage": "https://github.com/srod/node-minify/tree/master/packages/clean-css#readme",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
15
|
+
"node": ">=16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"directories": {
|
|
18
18
|
"lib": "dist",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"clean": "pnpm dlx rimraf dist",
|
|
44
|
-
"build": "
|
|
45
|
-
"prepublishOnly": "
|
|
44
|
+
"build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
|
|
45
|
+
"prepublishOnly": "pnpm build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@node-minify/utils": "8.0.
|
|
49
|
-
"clean-css": "5.3.
|
|
48
|
+
"@node-minify/utils": "8.0.3-beta.0",
|
|
49
|
+
"clean-css": "5.3.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@node-minify/types": "8.0.
|
|
52
|
+
"@node-minify/types": "8.0.3-beta.0",
|
|
53
53
|
"@types/clean-css": "^4.2.6"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "f79e146eed24ca117756cf029eb5005631f12892"
|
|
56
56
|
}
|