This commit is contained in:
Moshe Brevda 2024-06-05 15:14:41 +03:00 committed by GitHub
commit 441abd81c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 9 deletions

5
.gitignore vendored
View File

@ -1,3 +1,4 @@
/node_modules/
/npm-debug.log
index.js.map
node_modules/
npm-debug.log
tmp/

View File

@ -8,7 +8,7 @@ require("../tools/tty");
var fs = require("fs");
var info = require("../package.json");
var path = require("path");
var UglifyJS = require("../tools/node");
var UglifyJS = require("..");
var skip_keys = [ "cname", "fixed", "in_arg", "inlined", "length_read", "parent_scope", "redef", "scope", "unused" ];
var truthy_keys = [ "optional", "pure", "terminal", "uses_arguments", "uses_eval", "uses_with" ];
@ -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);

1
index.js Normal file
View File

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

View File

@ -12,14 +12,14 @@
"Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)"
],
"repository": "mishoo/UglifyJS",
"main": "tools/node.js",
"main": "index.js",
"bin": {
"uglifyjs": "bin/uglifyjs"
},
"files": [
"bin",
"lib",
"tools",
"index.js",
"index.js.map",
"tools/tty.js",
"LICENSE"
],
"devDependencies": {
@ -27,7 +27,8 @@
"semver": "~6.3.0"
},
"scripts": {
"test": "node test/compress.js && node test/mocha.js"
"test": "node test/compress.js && node test/mocha.js",
"prepack": "node bin/uglifyjs --self --no-wrap --beautify --source-map --output index.js"
},
"keywords": [
"cli",

View File

@ -59,3 +59,4 @@ npm --version
while !(npm install); do
while !(npm cache clean --force); do echo "'npm cache clean' failed - retrying..."; done
done
npm run prepack