fix dev
This commit is contained in:
parent
8921df00e7
commit
c5f8baddab
|
|
@ -1,8 +1,7 @@
|
||||||
|
import { g } from "utils/global";
|
||||||
import { validate } from "uuid";
|
import { validate } from "uuid";
|
||||||
import { glb } from "./global";
|
import { glb } from "./global";
|
||||||
import { server } from "./ws/sync/editor/code/server-main";
|
import { server } from "./ws/sync/editor/code/server-main";
|
||||||
import { g } from "utils/global";
|
|
||||||
import { waitUntil } from "web-utils";
|
|
||||||
glb.npm = { page: {}, site: {} };
|
glb.npm = { page: {}, site: {} };
|
||||||
|
|
||||||
glb.ws_hook = {
|
glb.ws_hook = {
|
||||||
|
|
|
||||||
|
|
@ -149,11 +149,7 @@ if (typeof global.server_hook === "function") {
|
||||||
server.init(id_site);
|
server.init(id_site);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
if (g.mode === "dev") {
|
|
||||||
setTimeout(reinit, 1000);
|
|
||||||
} else {
|
|
||||||
reinit();
|
reinit();
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,12 @@ const serverMain = () => ({
|
||||||
);
|
);
|
||||||
delete require.cache[server_src_path];
|
delete require.cache[server_src_path];
|
||||||
const svr = require(server_src_path);
|
const svr = require(server_src_path);
|
||||||
|
|
||||||
if (svr && typeof svr.server === "object") {
|
if (svr && typeof svr.server === "object") {
|
||||||
this.handler[site_id] = svr.server;
|
this.handler[site_id] = svr.server;
|
||||||
this.handler[site_id].site_id = site_id;
|
this.handler[site_id].site_id = site_id;
|
||||||
|
|
||||||
if (typeof svr.init === "function") {
|
if (typeof svr.server.init === "function") {
|
||||||
svr.init();
|
svr.server.init({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"module": "src/index.ts",
|
"module": "src/index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"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",
|
"clean": "rm -rf data/lmdb && rm -rf app/static && rm -rf app/web/.parcel-cache",
|
||||||
"build": "bun run --silent ./pkgs/core/build.ts",
|
"build": "bun run --silent ./pkgs/core/build.ts",
|
||||||
"build-site": "bun run --silent ./pkgs/core/build-site.ts",
|
"build-site": "bun run --silent ./pkgs/core/build-site.ts",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue