@node-minify/cssnano 9.0.1 → 10.0.0-next.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.cjs ADDED
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ default: () => src_default
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+ var import_utils = require("@node-minify/utils");
37
+ var import_cssnano = __toESM(require("cssnano"), 1);
38
+ var import_postcss = __toESM(require("postcss"), 1);
39
+ var minifyCssnano = async ({
40
+ settings,
41
+ content,
42
+ callback,
43
+ index
44
+ }) => {
45
+ let contentMinified = { css: "" };
46
+ try {
47
+ contentMinified = await (0, import_postcss.default)([import_cssnano.default]).process(content || "", {
48
+ from: void 0
49
+ });
50
+ } catch (e) {
51
+ if (callback) {
52
+ return callback(e);
53
+ }
54
+ }
55
+ if (settings && !settings.content && settings.output) {
56
+ settings.output && import_utils.utils.writeFile({
57
+ file: settings.output,
58
+ content: contentMinified.css,
59
+ index
60
+ });
61
+ }
62
+ if (callback) {
63
+ return callback(null, contentMinified.css);
64
+ }
65
+ return contentMinified.css;
66
+ };
67
+ minifyCssnano.default = minifyCssnano;
68
+ var src_default = minifyCssnano;
69
+ /*!
70
+ * node-minify
71
+ * Copyright(c) 2011-2024 Rodolphe Stoclin
72
+ * MIT Licensed
73
+ */
74
+
75
+ // fix-cjs-exports
76
+ if (module.exports.default) {
77
+ Object.assign(module.exports.default, module.exports);
78
+ module.exports = module.exports.default;
79
+ delete module.exports.default;
80
+ }
@@ -12,3 +12,4 @@ declare const minifyCssnano: {
12
12
  };
13
13
 
14
14
  export { minifyCssnano as default };
15
+ export = minifyCssnano
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ declare const minifyCssnano: {
12
12
  };
13
13
 
14
14
  export { minifyCssnano as default };
15
+ export = minifyCssnano
package/dist/index.js CHANGED
@@ -1,31 +1,7 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (let key of __getOwnPropNames(from))
11
- if (!__hasOwnProp.call(to, key) && key !== except)
12
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- }
14
- return to;
15
- };
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.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
- mod
23
- ));
24
-
25
1
  // src/index.ts
26
- var import_utils = require("@node-minify/utils");
27
- var import_cssnano = __toESM(require("cssnano"));
28
- var import_postcss = __toESM(require("postcss"));
2
+ import { utils } from "@node-minify/utils";
3
+ import cssnano from "cssnano";
4
+ import postcss from "postcss";
29
5
  var minifyCssnano = async ({
30
6
  settings,
31
7
  content,
@@ -34,7 +10,7 @@ var minifyCssnano = async ({
34
10
  }) => {
35
11
  let contentMinified = { css: "" };
36
12
  try {
37
- contentMinified = await (0, import_postcss.default)([import_cssnano.default]).process(content || "", {
13
+ contentMinified = await postcss([cssnano]).process(content || "", {
38
14
  from: void 0
39
15
  });
40
16
  } catch (e) {
@@ -43,7 +19,7 @@ var minifyCssnano = async ({
43
19
  }
44
20
  }
45
21
  if (settings && !settings.content && settings.output) {
46
- settings.output && import_utils.utils.writeFile({
22
+ settings.output && utils.writeFile({
47
23
  file: settings.output,
48
24
  content: contentMinified.css,
49
25
  index
@@ -55,10 +31,12 @@ var minifyCssnano = async ({
55
31
  return contentMinified.css;
56
32
  };
57
33
  minifyCssnano.default = minifyCssnano;
58
- module.exports = minifyCssnano;
34
+ var src_default = minifyCssnano;
35
+ export {
36
+ src_default as default
37
+ };
59
38
  /*!
60
39
  * node-minify
61
40
  * Copyright(c) 2011-2024 Rodolphe Stoclin
62
41
  * MIT Licensed
63
42
  */
64
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-minify/cssnano",
3
- "version": "9.0.1",
3
+ "version": "10.0.0-next.0",
4
4
  "description": "cssnano plugin for @node-minify",
5
5
  "keywords": [
6
6
  "compressor",
@@ -9,23 +9,22 @@
9
9
  "cssnano"
10
10
  ],
11
11
  "author": "Rodolphe Stoclin <srodolphe@gmail.com>",
12
- "homepage": "https://github.com/srod/node-minify/tree/master/packages/cssnano#readme",
12
+ "homepage": "https://github.com/srod/node-minify/tree/main/packages/cssnano#readme",
13
13
  "license": "MIT",
14
+ "type": "module",
14
15
  "engines": {
15
- "node": ">=18.0.0"
16
+ "node": ">=22.0.0"
16
17
  },
17
18
  "directories": {
18
19
  "lib": "dist",
19
20
  "test": "__tests__"
20
21
  },
21
- "main": "./dist/index.js",
22
- "module": "./dist/index.mjs",
23
- "types": "./dist/index.d.ts",
22
+ "main": "./dist/index.cjs",
24
23
  "exports": {
24
+ "./package.json": "./package.json",
25
25
  ".": {
26
- "types": "./dist/index.d.ts",
27
- "import": "./dist/index.mjs",
28
- "require": "./dist/index.js"
26
+ "import": "./dist/index.js",
27
+ "default": "./dist/index.cjs"
29
28
  }
30
29
  },
31
30
  "files": [
@@ -41,20 +40,22 @@
41
40
  "bugs": {
42
41
  "url": "https://github.com/srod/node-minify/issues"
43
42
  },
44
- "dependencies": {
45
- "cssnano": "^6.0.0",
46
- "postcss": "8.4.47",
47
- "@node-minify/utils": "9.0.1"
48
- },
49
- "devDependencies": {
50
- "@node-minify/types": "9.0.0"
51
- },
52
43
  "scripts": {
53
- "clean": "pnpm dlx rimraf dist",
54
- "build": "pnpm clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
44
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean && bunx fix-tsup-cjs",
45
+ "check-exports": "attw --pack .",
46
+ "format:check": "biome check .",
55
47
  "lint": "biome lint .",
48
+ "prepublishOnly": "bun run build",
56
49
  "test": "vitest run",
57
50
  "test:ci": "vitest run --coverage",
58
51
  "test:watch": "vitest"
52
+ },
53
+ "dependencies": {
54
+ "@node-minify/utils": "workspace:*",
55
+ "cssnano": "^7.0.6",
56
+ "postcss": "8.4.49"
57
+ },
58
+ "devDependencies": {
59
+ "@node-minify/types": "workspace:*"
59
60
  }
60
- }
61
+ }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2024 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { MinifierOptions } from \"@node-minify/types\";\nimport { utils } from \"@node-minify/utils\";\nimport cssnano from \"cssnano\";\nimport postcss from \"postcss\";\n\n/**\n * Run cssnano.\n * @param settings Cssnano options\n * @param content Content to minify\n * @param callback Callback\n * @param index Index of current file in array\n * @returns Minified content\n */\nconst minifyCssnano = async ({\n settings,\n content,\n callback,\n index,\n}: MinifierOptions) => {\n let contentMinified = { css: \"\" };\n try {\n contentMinified = await postcss([cssnano]).process(content || \"\", {\n from: undefined,\n });\n } catch (e) {\n if (callback) {\n return callback(e);\n }\n }\n if (settings && !settings.content && settings.output) {\n settings.output &&\n utils.writeFile({\n file: settings.output,\n content: contentMinified.css,\n index,\n });\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":";;;;;;;;;;;;;;;;;;;;;;;;;AAUA,mBAAsB;AACtB,qBAAoB;AACpB,qBAAoB;AAUpB,IAAM,gBAAgB,OAAO;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,MAAuB;AACnB,MAAI,kBAAkB,EAAE,KAAK,GAAG;AAChC,MAAI;AACA,sBAAkB,UAAM,eAAAA,SAAQ,CAAC,eAAAC,OAAO,CAAC,EAAE,QAAQ,WAAW,IAAI;AAAA,MAC9D,MAAM;AAAA,IACV,CAAC;AAAA,EACL,SAAS,GAAG;AACR,QAAI,UAAU;AACV,aAAO,SAAS,CAAC;AAAA,IACrB;AAAA,EACJ;AACA,MAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AAClD,aAAS,UACL,mBAAM,UAAU;AAAA,MACZ,MAAM,SAAS;AAAA,MACf,SAAS,gBAAgB;AAAA,MACzB;AAAA,IACJ,CAAC;AAAA,EACT;AACA,MAAI,UAAU;AACV,WAAO,SAAS,MAAM,gBAAgB,GAAG;AAAA,EAC7C;AACA,SAAO,gBAAgB;AAC3B;AAKA,cAAc,UAAU;AACxB,iBAAS;","names":["postcss","cssnano"]}
package/dist/index.mjs DELETED
@@ -1,50 +0,0 @@
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
-
6
- // src/index.ts
7
- import { utils } from "@node-minify/utils";
8
- import cssnano from "cssnano";
9
- import postcss from "postcss";
10
- var require_src = __commonJS({
11
- "src/index.ts"(exports, module) {
12
- var minifyCssnano = async ({
13
- settings,
14
- content,
15
- callback,
16
- index
17
- }) => {
18
- let contentMinified = { css: "" };
19
- try {
20
- contentMinified = await postcss([cssnano]).process(content || "", {
21
- from: void 0
22
- });
23
- } catch (e) {
24
- if (callback) {
25
- return callback(e);
26
- }
27
- }
28
- if (settings && !settings.content && settings.output) {
29
- settings.output && utils.writeFile({
30
- file: settings.output,
31
- content: contentMinified.css,
32
- index
33
- });
34
- }
35
- if (callback) {
36
- return callback(null, contentMinified.css);
37
- }
38
- return contentMinified.css;
39
- };
40
- minifyCssnano.default = minifyCssnano;
41
- module.exports = minifyCssnano;
42
- }
43
- });
44
- export default require_src();
45
- /*!
46
- * node-minify
47
- * Copyright(c) 2011-2024 Rodolphe Stoclin
48
- * MIT Licensed
49
- */
50
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/*!\n * node-minify\n * Copyright(c) 2011-2024 Rodolphe Stoclin\n * MIT Licensed\n */\n\n/**\n * Module dependencies.\n */\nimport type { MinifierOptions } from \"@node-minify/types\";\nimport { utils } from \"@node-minify/utils\";\nimport cssnano from \"cssnano\";\nimport postcss from \"postcss\";\n\n/**\n * Run cssnano.\n * @param settings Cssnano options\n * @param content Content to minify\n * @param callback Callback\n * @param index Index of current file in array\n * @returns Minified content\n */\nconst minifyCssnano = async ({\n settings,\n content,\n callback,\n index,\n}: MinifierOptions) => {\n let contentMinified = { css: \"\" };\n try {\n contentMinified = await postcss([cssnano]).process(content || \"\", {\n from: undefined,\n });\n } catch (e) {\n if (callback) {\n return callback(e);\n }\n }\n if (settings && !settings.content && settings.output) {\n settings.output &&\n utils.writeFile({\n file: settings.output,\n content: contentMinified.css,\n index,\n });\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":";;;;;;AAUA,SAAS,aAAa;AACtB,OAAO,aAAa;AACpB,OAAO,aAAa;AAZpB;AAAA;AAsBA,QAAM,gBAAgB,OAAO;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ,MAAuB;AACnB,UAAI,kBAAkB,EAAE,KAAK,GAAG;AAChC,UAAI;AACA,0BAAkB,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,WAAW,IAAI;AAAA,UAC9D,MAAM;AAAA,QACV,CAAC;AAAA,MACL,SAAS,GAAG;AACR,YAAI,UAAU;AACV,iBAAO,SAAS,CAAC;AAAA,QACrB;AAAA,MACJ;AACA,UAAI,YAAY,CAAC,SAAS,WAAW,SAAS,QAAQ;AAClD,iBAAS,UACL,MAAM,UAAU;AAAA,UACZ,MAAM,SAAS;AAAA,UACf,SAAS,gBAAgB;AAAA,UACzB;AAAA,QACJ,CAAC;AAAA,MACT;AACA,UAAI,UAAU;AACV,eAAO,SAAS,MAAM,gBAAgB,GAAG;AAAA,MAC7C;AACA,aAAO,gBAAgB;AAAA,IAC3B;AAKA,kBAAc,UAAU;AACxB,qBAAS;AAAA;AAAA;","names":[]}