This commit is contained in:
parent
6784c6fa54
commit
2e1f313ed0
10
src/build.ts
10
src/build.ts
|
@ -8,14 +8,14 @@ import { WebSocketServer } from 'ws';
|
|||
|
||||
const argv = process.argv.slice(2)
|
||||
|
||||
function buildTs() {
|
||||
async function buildTs() {
|
||||
console.log("[dev] Building file..")
|
||||
esbuild.build({
|
||||
await esbuild.build({
|
||||
entryPoints: ["./src/web/ts/index.ts"],
|
||||
outfile: "./src/web/dist.js"
|
||||
})
|
||||
}
|
||||
buildTs();
|
||||
await buildTs();
|
||||
|
||||
if(argv[0] == "--build") {
|
||||
try{rmdirSync("./dist")}catch{}
|
||||
|
@ -93,10 +93,10 @@ if(argv[0] == "--dev") {
|
|||
console.log('[http] Listening HTTP on 8080.')
|
||||
const watcher = watch("./src/web", {
|
||||
recursive: true,
|
||||
}, (e,f) => {
|
||||
}, async (e,f) => {
|
||||
if(f == "dist.js") return;
|
||||
console.log("[dev] Noticed update in " + f + ", of type " + e +".")
|
||||
allConnections.forEach(z => z.send("refresh"));
|
||||
buildTs();
|
||||
await buildTs();
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue