@node-minify/clean-css 8.0.5 → 8.0.6
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.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
var import_clean_css = __toESM(require("clean-css"));
|
|
27
27
|
var import_utils = require("@node-minify/utils");
|
|
28
28
|
var minifyCleanCSS = ({ settings, content, callback, index }) => {
|
|
29
|
-
if (settings
|
|
29
|
+
if (settings?.options?.sourceMap) {
|
|
30
30
|
settings.options._sourceMap = settings.options.sourceMap;
|
|
31
31
|
settings.options.sourceMap = true;
|
|
32
32
|
}
|
|
33
|
-
const _cleanCSS = new import_clean_css.default(settings && settings.options).minify(content
|
|
33
|
+
const _cleanCSS = new import_clean_css.default(settings && { returnPromise: false, ...settings.options }).minify(content ?? "");
|
|
34
34
|
const contentMinified = _cleanCSS.styles;
|
|
35
|
-
if (_cleanCSS.sourceMap &&
|
|
35
|
+
if (_cleanCSS.sourceMap && typeof settings?.options?._sourceMap === "object") {
|
|
36
36
|
import_utils.utils.writeFile({
|
|
37
|
-
file: settings.options._sourceMap.url ? settings.options._sourceMap.url : "",
|
|
37
|
+
file: typeof settings.options._sourceMap.url === "string" ? settings.options._sourceMap.url : "",
|
|
38
38
|
content: _cleanCSS.sourceMap.toString(),
|
|
39
39
|
index
|
|
40
40
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 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
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 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// type OptionsPossibleCleanCSS = string | boolean | Record<string, string> | { url: string };\n\n// type OptionsCleanCSS = {\n// // _sourceMap: boolean | { url: string };\n// // sourceMap: boolean | { url: string };\n// [Key: string]: OptionsPossibleCleanCSS | Record<string, OptionsPossibleCleanCSS>;\n// };\n\n// type SettingsCleanCSS = {\n// options: OptionsCleanCSS;\n// };\n\n// type MinifierOptionsCleanCSS = {\n// settings: SettingsCleanCSS;\n// };\n\n/**\n * Run clean-css.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n * @param {Number} index\n */\nconst minifyCleanCSS = ({ settings, content, callback, index }: MinifierOptions) => {\n if (settings?.options?.sourceMap) {\n settings.options._sourceMap = settings.options.sourceMap;\n settings.options.sourceMap = true;\n }\n const _cleanCSS = new CleanCSS(settings && { returnPromise: false, ...settings.options }).minify(content ?? '');\n const contentMinified = _cleanCSS.styles;\n if (_cleanCSS.sourceMap && typeof settings?.options?._sourceMap === 'object') {\n utils.writeFile({\n file: typeof settings.options._sourceMap.url === 'string' ? 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;AA2BtB,IAAM,iBAAiB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AAClF,MAAI,UAAU,SAAS,WAAW;AAChC,aAAS,QAAQ,aAAa,SAAS,QAAQ;AAC/C,aAAS,QAAQ,YAAY;AAAA,EAC/B;AACA,QAAM,YAAY,IAAI,iBAAAA,QAAS,YAAY,EAAE,eAAe,OAAO,GAAG,SAAS,QAAQ,CAAC,EAAE,OAAO,WAAW,EAAE;AAC9G,QAAM,kBAAkB,UAAU;AAClC,MAAI,UAAU,aAAa,OAAO,UAAU,SAAS,eAAe,UAAU;AAC5E,uBAAM,UAAU;AAAA,MACd,MAAM,OAAO,SAAS,QAAQ,WAAW,QAAQ,WAAW,SAAS,QAAQ,WAAW,MAAM;AAAA,MAC9F,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
|
@@ -9,15 +9,15 @@ import { utils } from "@node-minify/utils";
|
|
|
9
9
|
var require_src = __commonJS({
|
|
10
10
|
"src/index.ts"(exports, module) {
|
|
11
11
|
var minifyCleanCSS = ({ settings, content, callback, index }) => {
|
|
12
|
-
if (settings
|
|
12
|
+
if (settings?.options?.sourceMap) {
|
|
13
13
|
settings.options._sourceMap = settings.options.sourceMap;
|
|
14
14
|
settings.options.sourceMap = true;
|
|
15
15
|
}
|
|
16
|
-
const _cleanCSS = new CleanCSS(settings && settings.options).minify(content
|
|
16
|
+
const _cleanCSS = new CleanCSS(settings && { returnPromise: false, ...settings.options }).minify(content ?? "");
|
|
17
17
|
const contentMinified = _cleanCSS.styles;
|
|
18
|
-
if (_cleanCSS.sourceMap &&
|
|
18
|
+
if (_cleanCSS.sourceMap && typeof settings?.options?._sourceMap === "object") {
|
|
19
19
|
utils.writeFile({
|
|
20
|
-
file: settings.options._sourceMap.url ? settings.options._sourceMap.url : "",
|
|
20
|
+
file: typeof settings.options._sourceMap.url === "string" ? settings.options._sourceMap.url : "",
|
|
21
21
|
content: _cleanCSS.sourceMap.toString(),
|
|
22
22
|
index
|
|
23
23
|
});
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 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
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2023 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// type OptionsPossibleCleanCSS = string | boolean | Record<string, string> | { url: string };\n\n// type OptionsCleanCSS = {\n// // _sourceMap: boolean | { url: string };\n// // sourceMap: boolean | { url: string };\n// [Key: string]: OptionsPossibleCleanCSS | Record<string, OptionsPossibleCleanCSS>;\n// };\n\n// type SettingsCleanCSS = {\n// options: OptionsCleanCSS;\n// };\n\n// type MinifierOptionsCleanCSS = {\n// settings: SettingsCleanCSS;\n// };\n\n/**\n * Run clean-css.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n * @param {Number} index\n */\nconst minifyCleanCSS = ({ settings, content, callback, index }: MinifierOptions) => {\n if (settings?.options?.sourceMap) {\n settings.options._sourceMap = settings.options.sourceMap;\n settings.options.sourceMap = true;\n }\n const _cleanCSS = new CleanCSS(settings && { returnPromise: false, ...settings.options }).minify(content ?? '');\n const contentMinified = _cleanCSS.styles;\n if (_cleanCSS.sourceMap && typeof settings?.options?._sourceMap === 'object') {\n utils.writeFile({\n file: typeof settings.options._sourceMap.url === 'string' ? 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;AAqCA,QAAM,iBAAiB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AAClF,UAAI,UAAU,SAAS,WAAW;AAChC,iBAAS,QAAQ,aAAa,SAAS,QAAQ;AAC/C,iBAAS,QAAQ,YAAY;AAAA,MAC/B;AACA,YAAM,YAAY,IAAI,SAAS,YAAY,EAAE,eAAe,OAAO,GAAG,SAAS,QAAQ,CAAC,EAAE,OAAO,WAAW,EAAE;AAC9G,YAAM,kBAAkB,UAAU;AAClC,UAAI,UAAU,aAAa,OAAO,UAAU,SAAS,eAAe,UAAU;AAC5E,cAAM,UAAU;AAAA,UACd,MAAM,OAAO,SAAS,QAAQ,WAAW,QAAQ,WAAW,SAAS,QAAQ,WAAW,MAAM;AAAA,UAC9F,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.6",
|
|
4
4
|
"description": "clean-css plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"prepublishOnly": "pnpm build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@node-minify/utils": "8.0.
|
|
48
|
+
"@node-minify/utils": "8.0.6",
|
|
49
49
|
"clean-css": "5.3.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@node-minify/types": "8.0.
|
|
52
|
+
"@node-minify/types": "8.0.6",
|
|
53
53
|
"@types/clean-css": "^4.2.6"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "9fb532af458cb6416ecfb7abfb9cc0a3b9cb42e1"
|
|
56
56
|
}
|