Replace fileSmasher with ncc.
This commit is contained in:
parent
640c2cdf92
commit
b40361caf0
3 changed files with 14 additions and 4 deletions
10
package-lock.json
generated
10
package-lock.json
generated
|
@ -20,6 +20,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.6.0",
|
"@types/node": "^20.6.0",
|
||||||
"@types/node-fetch": "^2.6.4",
|
"@types/node-fetch": "^2.6.4",
|
||||||
|
"@vercel/ncc": "^0.38.0",
|
||||||
"check-outdated": "^2.12.0",
|
"check-outdated": "^2.12.0",
|
||||||
"nodemon": "^3.0.1",
|
"nodemon": "^3.0.1",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
@ -228,6 +229,15 @@
|
||||||
"form-data": "^3.0.0"
|
"form-data": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@vercel/ncc": {
|
||||||
|
"version": "0.38.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.0.tgz",
|
||||||
|
"integrity": "sha512-B4YKZMm/EqMptKSFyAq4q2SlgJe+VCmEH6Y8gf/E1pTlWbsUJpuH1ymik2Ex3aYO5mCWwV1kaSYHSQOT8+4vHA==",
|
||||||
|
"dev": true,
|
||||||
|
"bin": {
|
||||||
|
"ncc": "dist/ncc/cli.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@webassemblyjs/ast": {
|
"node_modules/@webassemblyjs/ast": {
|
||||||
"version": "1.11.6",
|
"version": "1.11.6",
|
||||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz",
|
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz",
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
"dev:updateCheck": "check-outdated",
|
"dev:updateCheck": "check-outdated",
|
||||||
"dev:run": "nodemon --watch './**/*.ts' Binato.ts",
|
"dev:run": "nodemon --watch './**/*.ts' Binato.ts",
|
||||||
"build": "npm-run-all build:*",
|
"build": "npm-run-all build:*",
|
||||||
"build:smash": "ts-node ./tooling/fileSmasher.ts",
|
"build:build": "ncc build Binato.ts -o build",
|
||||||
"build:build": "tsc --build",
|
|
||||||
"build:mangle": "ts-node ./tooling/mangle.ts",
|
"build:mangle": "ts-node ./tooling/mangle.ts",
|
||||||
"build:cleanup": "ts-node ./tooling/cleanup.ts",
|
"build:cleanup": "ts-node ./tooling/cleanup.ts",
|
||||||
"_clean": "tsc --build --clean"
|
"_clean": "tsc --build --clean"
|
||||||
|
@ -28,6 +27,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.6.0",
|
"@types/node": "^20.6.0",
|
||||||
"@types/node-fetch": "^2.6.4",
|
"@types/node-fetch": "^2.6.4",
|
||||||
|
"@vercel/ncc": "^0.38.0",
|
||||||
"check-outdated": "^2.12.0",
|
"check-outdated": "^2.12.0",
|
||||||
"nodemon": "^3.0.1",
|
"nodemon": "^3.0.1",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
|
|
@ -5,11 +5,11 @@ const DISABLE = false;
|
||||||
writeFileSync("./build/.MANGLED", `${DISABLE}`);
|
writeFileSync("./build/.MANGLED", `${DISABLE}`);
|
||||||
|
|
||||||
if (DISABLE) {
|
if (DISABLE) {
|
||||||
writeFileSync("./build/Binato.js", readFileSync("./build/combined.js"));
|
writeFileSync("./build/Binato.js", readFileSync("./build/index.js"));
|
||||||
console.warn("[WARNING] mangle.ts is disabled!");
|
console.warn("[WARNING] mangle.ts is disabled!");
|
||||||
} else {
|
} else {
|
||||||
(async () => {
|
(async () => {
|
||||||
const mangled = await minify(readFileSync("./build/combined.js").toString(), {
|
const mangled = await minify(readFileSync("./build/index.js").toString(), {
|
||||||
mangle: true,
|
mangle: true,
|
||||||
toplevel: true,
|
toplevel: true,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue