Skip to content

Commit dd3f07b

Browse files
committed
bootstrap node
1 parent f0fd2e5 commit dd3f07b

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,4 @@ src/webpage/translations/langs.js
140140

141141
package-lock.json
142142
pnpm-lock.yaml
143+
build.js

buildnode.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as swc from "@swc/core";
2+
import path from "node:path";
3+
import {fileURLToPath} from "node:url";
4+
import {promises as fs} from "fs";
5+
import child_process from "child_process";
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
10+
const mod = await swc.transformFile(path.join(__dirname, "build.ts"), {
11+
minify: true,
12+
sourceMaps: true,
13+
isModule: true,
14+
});
15+
16+
await fs.writeFile(path.join(__dirname, "build.js"), mod.code);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"bunBuild": "bun build.ts",
9-
"build": "node --experimental-strip-types build.ts",
9+
"build": "node buildnode.js && node build.js",
1010
"start": "node dist/index.js"
1111
},
1212
"author": "MathMan05",

0 commit comments

Comments
 (0)