@node-minify/cssnano 8.0.1-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 +4 -8
- package/dist/index.js +9 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
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 minifyCssnano: ({ settings, content, callback, index }: MinifierOptions) => Promise<any>;
|
|
9
|
+
declare const minifyCssnano: {
|
|
10
|
+
({ settings, content, callback, index }: MinifierOptions): Promise<string | void>;
|
|
11
|
+
default: any;
|
|
12
|
+
};
|
|
17
13
|
|
|
18
14
|
export { minifyCssnano 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))
|
|
@@ -17,17 +14,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
14
|
return to;
|
|
18
15
|
};
|
|
19
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.
|
|
20
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
22
|
mod
|
|
22
23
|
));
|
|
23
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
24
|
|
|
25
25
|
// src/index.ts
|
|
26
|
-
var src_exports = {};
|
|
27
|
-
__export(src_exports, {
|
|
28
|
-
default: () => src_default
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(src_exports);
|
|
31
26
|
var import_postcss = __toESM(require("postcss"));
|
|
32
27
|
var import_cssnano = __toESM(require("cssnano"));
|
|
33
28
|
var import_utils = require("@node-minify/utils");
|
|
@@ -40,17 +35,16 @@ var minifyCssnano = async ({ settings, content, callback, index }) => {
|
|
|
40
35
|
return callback(e);
|
|
41
36
|
}
|
|
42
37
|
}
|
|
43
|
-
if (settings && !settings.content) {
|
|
44
|
-
import_utils.utils.writeFile({ file: settings.output, content: contentMinified.css, index });
|
|
38
|
+
if (settings && !settings.content && settings.output) {
|
|
39
|
+
settings.output && import_utils.utils.writeFile({ file: settings.output, content: contentMinified.css, index });
|
|
45
40
|
}
|
|
46
41
|
if (callback) {
|
|
47
42
|
return callback(null, contentMinified.css);
|
|
48
43
|
}
|
|
49
44
|
return contentMinified.css;
|
|
50
45
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
0 && (module.exports = {});
|
|
46
|
+
minifyCssnano.default = minifyCssnano;
|
|
47
|
+
module.exports = minifyCssnano;
|
|
54
48
|
/*!
|
|
55
49
|
* node-minify
|
|
56
50
|
* Copyright(c) 2011-2022 Rodolphe Stoclin
|
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 postcss from 'postcss';\nimport cssnano from 'cssnano';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n
|
|
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 postcss from 'postcss';\nimport cssnano from 'cssnano';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n/**\n * Run cssnano.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyCssnano = async ({ settings, content, callback, index }: MinifierOptions) => {\n let contentMinified = { css: '' };\n try {\n contentMinified = await postcss([cssnano]).process(content || '', { from: undefined });\n } catch (e) {\n if (callback) {\n return callback(e);\n }\n }\n if (settings && !settings.content && settings.output) {\n settings.output && utils.writeFile({ file: settings.output, content: contentMinified.css, index });\n }\n if (callback) {\n return callback(null, contentMinified.css);\n }\n return contentMinified.css;\n};\n\n/**\n * Expose `minifyCssnano()`.\n */\nminifyCssnano.default = minifyCssnano;\nexport = minifyCssnano;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASA,qBAAoB;AACpB,qBAAoB;AACpB,mBAAsB;AAUtB,IAAM,gBAAgB,OAAO,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AACvF,MAAI,kBAAkB,EAAE,KAAK,GAAG;AAChC,MAAI;AACF,sBAAkB,UAAM,eAAAA,SAAQ,CAAC,eAAAC,OAAO,CAAC,EAAE,QAAQ,WAAW,IAAI,EAAE,MAAM,OAAU,CAAC;AAAA,EACvF,SAAS,GAAP;AACA,QAAI,UAAU;AACZ,aAAO,SAAS,CAAC;AAAA,IACnB;AAAA,EACF;AACA,MAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,aAAS,UAAU,mBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,gBAAgB,KAAK,MAAM,CAAC;AAAA,EACnG;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,gBAAgB,GAAG;AAAA,EAC3C;AACA,SAAO,gBAAgB;AACzB;AAKA,cAAc,UAAU;AACxB,iBAAS;","names":["postcss","cssnano"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,28 +1,36 @@
|
|
|
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 postcss from "postcss";
|
|
3
8
|
import cssnano from "cssnano";
|
|
4
9
|
import { utils } from "@node-minify/utils";
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
var require_src = __commonJS({
|
|
11
|
+
"src/index.ts"(exports, module) {
|
|
12
|
+
var minifyCssnano = async ({ settings, content, callback, index }) => {
|
|
13
|
+
let contentMinified = { css: "" };
|
|
14
|
+
try {
|
|
15
|
+
contentMinified = await postcss([cssnano]).process(content || "", { from: void 0 });
|
|
16
|
+
} catch (e) {
|
|
17
|
+
if (callback) {
|
|
18
|
+
return callback(e);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (settings && !settings.content && settings.output) {
|
|
22
|
+
settings.output && utils.writeFile({ file: settings.output, content: contentMinified.css, index });
|
|
23
|
+
}
|
|
24
|
+
if (callback) {
|
|
25
|
+
return callback(null, contentMinified.css);
|
|
26
|
+
}
|
|
27
|
+
return contentMinified.css;
|
|
28
|
+
};
|
|
29
|
+
minifyCssnano.default = minifyCssnano;
|
|
30
|
+
module.exports = minifyCssnano;
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var src_default = minifyCssnano;
|
|
23
|
-
export {
|
|
24
|
-
src_default as default
|
|
25
|
-
};
|
|
32
|
+
});
|
|
33
|
+
export default require_src();
|
|
26
34
|
/*!
|
|
27
35
|
* node-minify
|
|
28
36
|
* Copyright(c) 2011-2022 Rodolphe Stoclin
|
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 postcss from 'postcss';\nimport cssnano from 'cssnano';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n
|
|
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 postcss from 'postcss';\nimport cssnano from 'cssnano';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n/**\n * Run cssnano.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyCssnano = async ({ settings, content, callback, index }: MinifierOptions) => {\n let contentMinified = { css: '' };\n try {\n contentMinified = await postcss([cssnano]).process(content || '', { from: undefined });\n } catch (e) {\n if (callback) {\n return callback(e);\n }\n }\n if (settings && !settings.content && settings.output) {\n settings.output && utils.writeFile({ file: settings.output, content: contentMinified.css, index });\n }\n if (callback) {\n return callback(null, contentMinified.css);\n }\n return contentMinified.css;\n};\n\n/**\n * Expose `minifyCssnano()`.\n */\nminifyCssnano.default = minifyCssnano;\nexport = minifyCssnano;\n"],"mappings":";;;;;;AASA,OAAO,aAAa;AACpB,OAAO,aAAa;AACpB,SAAS,aAAa;AAXtB;AAAA;AAqBA,QAAM,gBAAgB,OAAO,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AACvF,UAAI,kBAAkB,EAAE,KAAK,GAAG;AAChC,UAAI;AACF,0BAAkB,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,WAAW,IAAI,EAAE,MAAM,OAAU,CAAC;AAAA,MACvF,SAAS,GAAP;AACA,YAAI,UAAU;AACZ,iBAAO,SAAS,CAAC;AAAA,QACnB;AAAA,MACF;AACA,UAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AACpD,iBAAS,UAAU,MAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,gBAAgB,KAAK,MAAM,CAAC;AAAA,MACnG;AACA,UAAI,UAAU;AACZ,eAAO,SAAS,MAAM,gBAAgB,GAAG;AAAA,MAC3C;AACA,aAAO,gBAAgB;AAAA,IACzB;AAKA,kBAAc,UAAU;AACxB,qBAAS;AAAA;AAAA;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-minify/cssnano",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.3-beta.0",
|
|
4
4
|
"description": "cssnano 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/cssnano#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.
|
|
48
|
+
"@node-minify/utils": "8.0.3-beta.0",
|
|
49
49
|
"cssnano": "^5.0.0",
|
|
50
|
-
"postcss": "8.4.
|
|
50
|
+
"postcss": "8.4.21"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@node-minify/types": "8.0.
|
|
53
|
+
"@node-minify/types": "8.0.3-beta.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "f79e146eed24ca117756cf029eb5005631f12892"
|
|
56
56
|
}
|