@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/cli.cjs
CHANGED
|
@@ -14530,11 +14530,15 @@ var getServerFile = async (projectRoot, fileName) => {
|
|
|
14530
14530
|
// modules/server/init.ts
|
|
14531
14531
|
var INIT_FILE_NAME = "init.server";
|
|
14532
14532
|
async function runInitIfExists(projectRoot, serverData) {
|
|
14533
|
-
|
|
14534
|
-
|
|
14535
|
-
|
|
14536
|
-
|
|
14537
|
-
|
|
14533
|
+
try {
|
|
14534
|
+
let mod = await getServerFile(projectRoot, INIT_FILE_NAME);
|
|
14535
|
+
if (typeof mod?.init === "function") {
|
|
14536
|
+
const serverContext = { ...serverData };
|
|
14537
|
+
await mod.init({ serverContext });
|
|
14538
|
+
return serverContext;
|
|
14539
|
+
}
|
|
14540
|
+
} catch (error) {
|
|
14541
|
+
console.error(`[Init] Failed to load or execute ${INIT_FILE_NAME}.ts:`, error);
|
|
14538
14542
|
}
|
|
14539
14543
|
return {};
|
|
14540
14544
|
}
|