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