This commit is contained in:
Rizky 2024-04-18 06:49:06 +07:00
parent 8921df00e7
commit c5f8baddab
4 changed files with 5 additions and 11 deletions

View File

@ -1,8 +1,7 @@
import { g } from "utils/global";
import { validate } from "uuid";
import { glb } from "./global";
import { server } from "./ws/sync/editor/code/server-main";
import { g } from "utils/global";
import { waitUntil } from "web-utils";
glb.npm = { page: {}, site: {} };
glb.ws_hook = {

View File

@ -149,11 +149,7 @@ if (typeof global.server_hook === "function") {
server.init(id_site);
});
};
if (g.mode === "dev") {
setTimeout(reinit, 1000);
} else {
reinit();
}
},
},
],

View File

@ -39,13 +39,12 @@ const serverMain = () => ({
);
delete require.cache[server_src_path];
const svr = require(server_src_path);
if (svr && typeof svr.server === "object") {
this.handler[site_id] = svr.server;
this.handler[site_id].site_id = site_id;
if (typeof svr.init === "function") {
svr.init();
if (typeof svr.server.init === "function") {
svr.server.init({});
}
}

View File

@ -3,7 +3,7 @@
"module": "src/index.ts",
"type": "module",
"scripts": {
"dev": "bun run --hot ./pkgs/core/index.ts dev",
"dev": "bun run ./pkgs/core/index.ts dev",
"clean": "rm -rf data/lmdb && rm -rf app/static && rm -rf app/web/.parcel-cache",
"build": "bun run --silent ./pkgs/core/build.ts",
"build-site": "bun run --silent ./pkgs/core/build-site.ts",