bootstrap node

This commit is contained in:
MathMan05 2025-05-02 14:05:31 -05:00
parent f0fd2e59b3
commit dd3f07b110
3 changed files with 18 additions and 1 deletions

1
.gitignore vendored
View file

@ -140,3 +140,4 @@ src/webpage/translations/langs.js
package-lock.json
pnpm-lock.yaml
build.js

16
buildnode.js Normal file
View file

@ -0,0 +1,16 @@
import * as swc from "@swc/core";
import path from "node:path";
import {fileURLToPath} from "node:url";
import {promises as fs} from "fs";
import child_process from "child_process";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const mod = await swc.transformFile(path.join(__dirname, "build.ts"), {
minify: true,
sourceMaps: true,
isModule: true,
});
await fs.writeFile(path.join(__dirname, "build.js"), mod.code);

View file

@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"bunBuild": "bun build.ts",
"build": "node --experimental-strip-types build.ts",
"build": "node buildnode.js && node build.js",
"start": "node dist/index.js"
},
"author": "MathMan05",