@node-minify/uglify-js 8.0.0-beta.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.
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -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 uglifyJS from 'uglify-js';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions, Options, Settings } from '@node-minify/types';\n\ninterface OptionsUglifyJS extends Omit<Options, 'sourceMap'> {\n sourceMap?: { filename: string };\n}\n\ninterface SettingsUglifyJS extends Omit<Settings, 'options'> {\n options: OptionsUglifyJS;\n}\n\ninterface MinifierOptionsUglifyJS extends Omit<MinifierOptions, 'settings'> {\n settings: SettingsUglifyJS;\n}\n\n// interface Options {\n// sourceMap?: { filename: string };\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 /* | Dictionary<string> */;\n// callback: Function;\n// index: number;\n// }\n\n/**\n * Run uglifyJS.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyUglifyJS = ({ settings, content, callback, index }: MinifierOptionsUglifyJS) => {\n const contentMinified = uglifyJS.minify(typeof content === 'string' ? content : '', settings && settings.options);\n if (contentMinified.error) {\n if (callback) {\n return callback(contentMinified.error);\n }\n }\n if (contentMinified.map && settings && typeof settings.options.sourceMap === 'object') {\n // TODO\n utils.writeFile({ file: settings.options.sourceMap.filename, content: contentMinified.map, index });\n }\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content: contentMinified.code, index });\n }\n if (callback) {\n return callback(null, contentMinified.code);\n }\n return contentMinified.code;\n};\n\n/**\n * Expose `minifyUglifyJS()`.\n */\nexport default minifyUglifyJS;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,uBAAqB;AACrB,mBAAsB;AAwCtB,IAAM,iBAAiB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAA+B;AAC1F,QAAM,kBAAkB,iBAAAA,QAAS,OAAO,OAAO,YAAY,WAAW,UAAU,IAAI,YAAY,SAAS,OAAO;AAChH,MAAI,gBAAgB,OAAO;AACzB,QAAI,UAAU;AACZ,aAAO,SAAS,gBAAgB,KAAK;AAAA,IACvC;AAAA,EACF;AACA,MAAI,gBAAgB,OAAO,YAAY,OAAO,SAAS,QAAQ,cAAc,UAAU;AAErF,uBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,UAAU,UAAU,SAAS,gBAAgB,KAAK,MAAM,CAAC;AAAA,EACpG;AACA,MAAI,YAAY,CAAC,SAAS,SAAS;AACjC,uBAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,gBAAgB,MAAM,MAAM,CAAC;AAAA,EACjF;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,gBAAgB,IAAI;AAAA,EAC5C;AACA,SAAO,gBAAgB;AACzB;AAKA,IAAO,cAAQ;","names":["uglifyJS"]}
|
package/dist/index.mjs
CHANGED
|
@@ -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 uglifyJS from 'uglify-js';\nimport { utils } from '@node-minify/utils';\nimport { MinifierOptions, Options, Settings } from '@node-minify/types';\n\ninterface OptionsUglifyJS extends Omit<Options, 'sourceMap'> {\n sourceMap?: { filename: string };\n}\n\ninterface SettingsUglifyJS extends Omit<Settings, 'options'> {\n options: OptionsUglifyJS;\n}\n\ninterface MinifierOptionsUglifyJS extends Omit<MinifierOptions, 'settings'> {\n settings: SettingsUglifyJS;\n}\n\n// interface Options {\n// sourceMap?: { filename: string };\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 /* | Dictionary<string> */;\n// callback: Function;\n// index: number;\n// }\n\n/**\n * Run uglifyJS.\n *\n * @param {Object} settings\n * @param {String} content\n * @param {Function} callback\n */\nconst minifyUglifyJS = ({ settings, content, callback, index }: MinifierOptionsUglifyJS) => {\n const contentMinified = uglifyJS.minify(typeof content === 'string' ? content : '', settings && settings.options);\n if (contentMinified.error) {\n if (callback) {\n return callback(contentMinified.error);\n }\n }\n if (contentMinified.map && settings && typeof settings.options.sourceMap === 'object') {\n // TODO\n utils.writeFile({ file: settings.options.sourceMap.filename, content: contentMinified.map, index });\n }\n if (settings && !settings.content) {\n utils.writeFile({ file: settings.output, content: contentMinified.code, index });\n }\n if (callback) {\n return callback(null, contentMinified.code);\n }\n return contentMinified.code;\n};\n\n/**\n * Expose `minifyUglifyJS()`.\n */\nexport default minifyUglifyJS;\n"],"mappings":";AASA,OAAO,cAAc;AACrB,SAAS,aAAa;AAwCtB,IAAM,iBAAiB,CAAC,EAAE,UAAU,SAAS,UAAU,MAAM,MAA+B;AAC1F,QAAM,kBAAkB,SAAS,OAAO,OAAO,YAAY,WAAW,UAAU,IAAI,YAAY,SAAS,OAAO;AAChH,MAAI,gBAAgB,OAAO;AACzB,QAAI,UAAU;AACZ,aAAO,SAAS,gBAAgB,KAAK;AAAA,IACvC;AAAA,EACF;AACA,MAAI,gBAAgB,OAAO,YAAY,OAAO,SAAS,QAAQ,cAAc,UAAU;AAErF,UAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,UAAU,UAAU,SAAS,gBAAgB,KAAK,MAAM,CAAC;AAAA,EACpG;AACA,MAAI,YAAY,CAAC,SAAS,SAAS;AACjC,UAAM,UAAU,EAAE,MAAM,SAAS,QAAQ,SAAS,gBAAgB,MAAM,MAAM,CAAC;AAAA,EACjF;AACA,MAAI,UAAU;AACZ,WAAO,SAAS,MAAM,gBAAgB,IAAI;AAAA,EAC5C;AACA,SAAO,gBAAgB;AACzB;AAKA,IAAO,cAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-minify/uglify-js",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1-beta.0",
|
|
4
4
|
"description": "uglify-js plugin for @node-minify",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compressor",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"clean": "pnpm dlx rimraf dist",
|
|
44
|
-
"build": "npm run clean && tsup src/index.ts --format cjs,esm --dts --clean",
|
|
44
|
+
"build": "npm run clean && tsup src/index.ts --format cjs,esm --dts --clean --sourcemap",
|
|
45
45
|
"prepublishOnly": "npm run build"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@node-minify/utils": "8.0.
|
|
48
|
+
"@node-minify/utils": "8.0.1-beta.0",
|
|
49
49
|
"uglify-js": "3.17.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@node-minify/types": "8.0.
|
|
52
|
+
"@node-minify/types": "8.0.1-beta.0",
|
|
53
53
|
"@types/uglify-js": "^3.17.1"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "35a8a41ec86a11cbec05d8a7db9113475ece2cef"
|
|
56
56
|
}
|