bootstrap node
This commit is contained in:
parent
f0fd2e59b3
commit
dd3f07b110
3 changed files with 18 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -140,3 +140,4 @@ src/webpage/translations/langs.js
|
|||
|
||||
package-lock.json
|
||||
pnpm-lock.yaml
|
||||
build.js
|
||||
|
|
16
buildnode.js
Normal file
16
buildnode.js
Normal 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);
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue