fix index.js packaging

- drop testing on unusable `npm` versions
This commit is contained in:
alexlamsl 2022-12-20 08:01:54 +08:00
parent 0988707745
commit a6313e031f
5 changed files with 10 additions and 9 deletions

View File

@ -7,7 +7,7 @@ jobs:
test:
strategy:
matrix:
node: [ '0.10', '0.12', '4', '6', '8', '10', '12', '14', '16', latest ]
node: [ '0.10', '0.12', '4', '6', '8', '10', '12', '14', '16', '18' ]
os: [ ubuntu-latest, windows-latest ]
script: [ compress, mocha, release/benchmark, release/jetstream ]
name: ${{ matrix.node }} ${{ matrix.os }} ${{ matrix.script }}

8
.gitignore vendored
View File

@ -1,6 +1,4 @@
/node_modules/
/npm-debug.log
tmp/
# files generated at build time
index.js.map
node_modules/
npm-debug.log
tmp/

View File

@ -175,6 +175,9 @@ function process_option(name, no_value) {
case "wrap":
options[name] = read_value(true);
break;
case "no-wrap":
options.wrap = false;
break;
case "verbose":
options.warnings = "verbose";
break;
@ -271,7 +274,7 @@ if (typeof options.sourceMap == "object" && "base" in options.sourceMap) {
}
if (specified["self"]) {
if (paths.length) UglifyJS.AST_Node.warn("Ignoring input files since --self was passed");
if (!options.wrap) options.wrap = "UglifyJS";
if (!("wrap" in options)) options.wrap = "UglifyJS";
paths = UglifyJS.FILES;
} else if (paths.length) {
paths = simple_glob(paths);

View File

@ -1 +1 @@
module.exports = require("./tools/node.js");
module.exports = require("./tools/node");

View File

@ -28,7 +28,7 @@
},
"scripts": {
"test": "node test/compress.js && node test/mocha.js",
"prepack": "bin/uglifyjs --self --beautify --source-map --output index.js"
"prepack": "node bin/uglifyjs --self --no-wrap --beautify --source-map --output index.js"
},
"keywords": [
"cli",