@node-minify/no-compress 7.1.0 → 8.0.1-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.
@@ -0,0 +1,18 @@
1
+ import { MinifierOptions } from '@node-minify/types';
2
+
3
+ /*!
4
+ * node-minify
5
+ * Copyright(c) 2011-2022 Rodolphe Stoclin
6
+ * MIT Licensed
7
+ */
8
+
9
+ /**
10
+ * Just merge, no compression.
11
+ *
12
+ * @param {Object} settings
13
+ * @param {String} content
14
+ * @param {Function} callback
15
+ */
16
+ declare const noCompress: ({ settings, content, callback, index }: MinifierOptions) => any;
17
+
18
+ export { noCompress as default };
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/index.ts
20
+ var src_exports = {};
21
+ __export(src_exports, {
22
+ default: () => src_default
23
+ });
24
+ module.exports = __toCommonJS(src_exports);
25
+ var import_utils = require("@node-minify/utils");
26
+ var noCompress = ({ settings, content, callback, index }) => {
27
+ if (settings && !settings.content) {
28
+ import_utils.utils.writeFile({ file: settings.output, content, index });
29
+ }
30
+ if (callback) {
31
+ return callback(null, content);
32
+ }
33
+ return content;
34
+ };
35
+ var src_default = noCompress;
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {});
38
+ /*!
39
+ * node-minify
40
+ * Copyright(c) 2011-2022 Rodolphe Stoclin
41
+ * MIT Licensed
42
+ */
43
+ //# 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 { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n// interface Options {\n// sourceMap?: boolean;\n// _sourceMap?: { url: string } | boolean;\n// }\n\n// interface Settings {\n// options: Options;\n// content: string;\n// output: string;\n// }\n\n// interface MinifierOptions {\n// settings: Settings;\n// content: string;\n// callback: Function;\n// index: number;\n// }\n\n/**\n * Just merge, no compression.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst noCompress = ({ settings, content, callback, index }: MinifierOptions) => {\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content, index });\n }\n if (callback) {\n return callback(null, content);\n }\n return content;\n};\n\n/**\n * Expose `noCompress()`.\n */\nexport default noCompress;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,mBAAsB;AA4BtB,IAAM,aAAa,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AAC9E,MAAI,YAAY,CAAC,SAAS,SAAS;AACjC,uBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,MAAM,CAAC;AAAA,EAC3D;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,OAAO;AAAA,EAC/B;AACA,SAAO;AACT;AAKA,IAAO,cAAQ;","names":[]}
package/dist/index.mjs ADDED
@@ -0,0 +1,21 @@
1
+ // src/index.ts
2
+ import { utils } from "@node-minify/utils";
3
+ var noCompress = ({ settings, content, callback, index }) => {
4
+ if (settings && !settings.content) {
5
+ utils.writeFile({ file: settings.output, content, index });
6
+ }
7
+ if (callback) {
8
+ return callback(null, content);
9
+ }
10
+ return content;
11
+ };
12
+ var src_default = noCompress;
13
+ export {
14
+ src_default as default
15
+ };
16
+ /*!
17
+ * node-minify
18
+ * Copyright(c) 2011-2022 Rodolphe Stoclin
19
+ * MIT Licensed
20
+ */
21
+ //# 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 { utils } from '@node-minify/utils';\nimport { MinifierOptions } from '@node-minify/types';\n\n// interface Options {\n// sourceMap?: boolean;\n// _sourceMap?: { url: string } | boolean;\n// }\n\n// interface Settings {\n// options: Options;\n// content: string;\n// output: string;\n// }\n\n// interface MinifierOptions {\n// settings: Settings;\n// content: string;\n// callback: Function;\n// index: number;\n// }\n\n/**\n * Just merge, no compression.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst noCompress = ({ settings, content, callback, index }: MinifierOptions) => {\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content, index });\n }\n if (callback) {\n return callback(null, content);\n }\n return content;\n};\n\n/**\n * Expose `noCompress()`.\n */\nexport default noCompress;\n"],"mappings":";AASA,SAAS,aAAa;AA4BtB,IAAM,aAAa,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAAuB;AAC9E,MAAI,YAAY,CAAC,SAAS,SAAS;AACjC,UAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,MAAM,CAAC;AAAA,EAC3D;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,OAAO;AAAA,EAC/B;AACA,SAAO;AACT;AAKA,IAAO,cAAQ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-minify/no-compress",
3
- "version": "7.1.0",
3
+ "version": "8.0.1-beta.0",
4
4
  "description": "no compress plugin for @node-minify, only concatenate",
5
5
  "keywords": [
6
6
  "concatenate"
@@ -8,16 +8,23 @@
8
8
  "author": "Rodolphe Stoclin <srodolphe@gmail.com>",
9
9
  "homepage": "https://github.com/srod/node-minify/tree/master/packages/no-compress#readme",
10
10
  "license": "MIT",
11
- "main": "lib/no-compress.js",
12
11
  "engines": {
13
12
  "node": ">=14.0.0"
14
13
  },
15
14
  "directories": {
16
- "lib": "lib",
15
+ "lib": "dist",
17
16
  "test": "__tests__"
18
17
  },
18
+ "main": "./dist/index.js",
19
+ "module": "./dist/index.mjs",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ "require": "./dist/index.js",
23
+ "import": "./dist/index.mjs",
24
+ "types": "./dist/index.d.ts"
25
+ },
19
26
  "files": [
20
- "lib"
27
+ "dist/**/*"
21
28
  ],
22
29
  "publishConfig": {
23
30
  "access": "public"
@@ -29,8 +36,16 @@
29
36
  "bugs": {
30
37
  "url": "https://github.com/srod/node-minify/issues"
31
38
  },
39
+ "scripts": {
40
+ "clean": "pnpm dlx rimraf dist",
41
+ "build": "npm run clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
42
+ "prepublishOnly": "npm run build"
43
+ },
32
44
  "dependencies": {
33
- "@node-minify/utils": "^7.1.0"
45
+ "@node-minify/utils": "8.0.1-beta.0"
46
+ },
47
+ "devDependencies": {
48
+ "@node-minify/types": "8.0.1-beta.0"
34
49
  },
35
- "gitHead": "94cef2d5d653c3bddc3e603b4e25c135b0b6f4b3"
50
+ "gitHead": "35a8a41ec86a11cbec05d8a7db9113475ece2cef"
36
51
  }
@@ -1,43 +0,0 @@
1
- "use strict";
2
-
3
- var _utils = require("@node-minify/utils");
4
- /*!
5
- * node-minify
6
- * Copyright(c) 2011-2022 Rodolphe Stoclin
7
- * MIT Licensed
8
- */
9
-
10
- /**
11
- * Module dependencies.
12
- */
13
-
14
- /**
15
- * Just merge, no compression.
16
- *
17
- * @param {Object} settings
18
- * @param {String} content
19
- * @param {Function} callback
20
- */
21
- const noCompress = ({
22
- settings,
23
- content,
24
- callback,
25
- index
26
- }) => {
27
- if (!settings.content) {
28
- _utils.utils.writeFile({
29
- file: settings.output,
30
- content,
31
- index
32
- });
33
- }
34
- if (callback) {
35
- return callback(null, content);
36
- }
37
- return content;
38
- };
39
-
40
- /**
41
- * Expose `noCompress()`.
42
- */
43
- module.exports = noCompress;