bootstrap node
This commit is contained in:
parent
f0fd2e59b3
commit
dd3f07b110
3 changed files with 18 additions and 1 deletions
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);
|
Loading…
Add table
Add a link
Reference in a new issue