Swap smasher out for @vercel/ncc
This commit is contained in:
parent
f1c4dcda75
commit
0c0d8f7711
3 changed files with 24 additions and 14 deletions
26
package-lock.json
generated
26
package-lock.json
generated
|
@ -13,11 +13,12 @@
|
|||
"hsconsole": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.8.9",
|
||||
"@types/node": "^20.8.10",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"check-outdated": "^2.12.0",
|
||||
"nodemon": "^3.0.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"terser": "^5.22.0",
|
||||
"terser": "^5.24.0",
|
||||
"ts-loader": "^9.5.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
|
@ -170,14 +171,23 @@
|
|||
"peer": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.8.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.9.tgz",
|
||||
"integrity": "sha512-UzykFsT3FhHb1h7yD4CA4YhBHq545JC0YnEz41xkipN88eKQtL6rSgocL5tbAP6Ola9Izm/Aw4Ora8He4x0BHg==",
|
||||
"version": "20.8.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz",
|
||||
"integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@vercel/ncc": {
|
||||
"version": "0.38.1",
|
||||
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz",
|
||||
"integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==",
|
||||
"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",
|
||||
|
@ -2328,9 +2338,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/terser": {
|
||||
"version": "5.22.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.22.0.tgz",
|
||||
"integrity": "sha512-hHZVLgRA2z4NWcN6aS5rQDc+7Dcy58HOf2zbYwmFcQ+ua3h6eEFf5lIDKTzbWwlazPyOZsFQO8V80/IjVNExEw==",
|
||||
"version": "5.24.0",
|
||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.24.0.tgz",
|
||||
"integrity": "sha512-ZpGR4Hy3+wBEzVEnHvstMvqpD/nABNelQn/z2r0fjVWGQsN3bpOLzQlqDxmb4CDZnXq5lpjnQ+mHQLAOpfM5iw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/source-map": "^0.3.3",
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
"dev:updateCheck": "check-outdated",
|
||||
"dev:run": "nodemon --watch './**/*.ts' index.ts",
|
||||
"build": "npm-run-all build:*",
|
||||
"build:smash": "ts-node ./tooling/fileSmasher.ts",
|
||||
"build:build": "tsc --build",
|
||||
"build:build": "ncc build index.ts -o build",
|
||||
"build:mangle": "ts-node ./tooling/mangle.ts",
|
||||
"build:cleanup": "ts-node ./tooling/cleanup.ts",
|
||||
"_clean": "tsc --build --clean"
|
||||
|
@ -29,11 +28,12 @@
|
|||
"hsconsole": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.8.9",
|
||||
"@types/node": "^20.8.10",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"check-outdated": "^2.12.0",
|
||||
"nodemon": "^3.0.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"terser": "^5.22.0",
|
||||
"terser": "^5.24.0",
|
||||
"ts-loader": "^9.5.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
|
|
|
@ -2,9 +2,9 @@ import { readFileSync, writeFileSync } from "fs";
|
|||
import { minify } from "terser";
|
||||
|
||||
(async () => {
|
||||
const mangled = await minify(readFileSync("./build/combined.js").toString(), {
|
||||
const mangled = await minify(readFileSync("./build/index.js").toString(), {
|
||||
mangle: true,
|
||||
toplevel: true,
|
||||
});
|
||||
writeFileSync("./build/index.min.js", `${mangled.code}`);
|
||||
writeFileSync("./build/index.min.js", `${mangled.code?.replaceAll("new Array", "[]")}`);
|
||||
})();
|
Loading…
Reference in a new issue