Replace fileSmasher with ncc.

This commit is contained in:
Holly Stubbs 2023-10-16 10:52:36 +01:00
parent 640c2cdf92
commit b40361caf0
3 changed files with 14 additions and 4 deletions

10
package-lock.json generated
View file

@ -20,6 +20,7 @@
"devDependencies": {
"@types/node": "^20.6.0",
"@types/node-fetch": "^2.6.4",
"@vercel/ncc": "^0.38.0",
"check-outdated": "^2.12.0",
"nodemon": "^3.0.1",
"npm-run-all": "^4.1.5",
@ -228,6 +229,15 @@
"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": {
"version": "1.11.6",
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz",

View file

@ -7,8 +7,7 @@
"dev:updateCheck": "check-outdated",
"dev:run": "nodemon --watch './**/*.ts' Binato.ts",
"build": "npm-run-all build:*",
"build:smash": "ts-node ./tooling/fileSmasher.ts",
"build:build": "tsc --build",
"build:build": "ncc build Binato.ts -o build",
"build:mangle": "ts-node ./tooling/mangle.ts",
"build:cleanup": "ts-node ./tooling/cleanup.ts",
"_clean": "tsc --build --clean"
@ -28,6 +27,7 @@
"devDependencies": {
"@types/node": "^20.6.0",
"@types/node-fetch": "^2.6.4",
"@vercel/ncc": "^0.38.0",
"check-outdated": "^2.12.0",
"nodemon": "^3.0.1",
"npm-run-all": "^4.1.5",

View file

@ -5,11 +5,11 @@ const DISABLE = false;
writeFileSync("./build/.MANGLED", `${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!");
} else {
(async () => {
const mangled = await minify(readFileSync("./build/combined.js").toString(), {
const mangled = await minify(readFileSync("./build/index.js").toString(), {
mangle: true,
toplevel: true,
});