mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
fix: improve server building on watch build
This commit is contained in:
parent
8d4b67e457
commit
58d1c013ab
1 changed files with 11 additions and 3 deletions
14
server.js
14
server.js
|
@ -4,6 +4,8 @@ import { createServer } from "http";
|
|||
import Fastify from "fastify";
|
||||
import fastifyStatic from "@fastify/static";
|
||||
import { join } from "node:path";
|
||||
import rspackConfig from "./rspack.config.js";
|
||||
import { rspack } from "@rspack/core";
|
||||
import { spawn } from "node:child_process";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { server as wisp } from "@mercuryworkshop/wisp-js/server";
|
||||
|
@ -94,8 +96,14 @@ if (!process.env.CI) {
|
|||
chmodSync(".git/hooks/pre-commit", 0o755);
|
||||
} catch {}
|
||||
|
||||
spawn("pnpm", ["rspack", "-w"], {
|
||||
stdio: "inherit",
|
||||
cwd: process.cwd(),
|
||||
const compiler = rspack(rspackConfig);
|
||||
compiler.watch({}, (err, stats) => {
|
||||
console.log(
|
||||
stats.toString({
|
||||
preset: "minimal",
|
||||
colors: true,
|
||||
version: false,
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue