@lolyjs/core 0.3.0-alpha.1 → 0.3.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +9 -5
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +9 -5
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9991,11 +9991,15 @@ var getServerFile = async (projectRoot, fileName) => {
|
|
|
9991
9991
|
// modules/server/init.ts
|
|
9992
9992
|
var INIT_FILE_NAME = "init.server";
|
|
9993
9993
|
async function runInitIfExists(projectRoot, serverData) {
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9994
|
+
try {
|
|
9995
|
+
let mod = await getServerFile(projectRoot, INIT_FILE_NAME);
|
|
9996
|
+
if (typeof mod?.init === "function") {
|
|
9997
|
+
const serverContext = { ...serverData };
|
|
9998
|
+
await mod.init({ serverContext });
|
|
9999
|
+
return serverContext;
|
|
10000
|
+
}
|
|
10001
|
+
} catch (error) {
|
|
10002
|
+
console.error(`[Init] Failed to load or execute ${INIT_FILE_NAME}.ts:`, error);
|
|
9999
10003
|
}
|
|
10000
10004
|
return {};
|
|
10001
10005
|
}
|