diff --git a/workspaces/remix-electron/src/index.mts b/workspaces/remix-electron/src/index.mts index c865566..4549c35 100644 --- a/workspaces/remix-electron/src/index.mts +++ b/workspaces/remix-electron/src/index.mts @@ -44,12 +44,12 @@ export async function initRemix({ const buildPath = typeof serverBuildOption === "string" - ? require.resolve(serverBuildOption) + ? import.meta.resolve(serverBuildOption) : undefined let serverBuild = typeof serverBuildOption === "string" - ? /** @type {ServerBuild} */ require(serverBuildOption) + ? /** @type {ServerBuild} */ await import(serverBuildOption) : serverBuildOption await app.whenReady() @@ -86,7 +86,7 @@ export async function initRemix({ for await (const _event of watch(buildPath)) { purgeRequireCache(buildPath) // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - serverBuild = require(buildPath) + serverBuild = await import(buildPath) await broadcastDevReady(serverBuild) } })()