diff --git a/js/desktop/src/env.ts b/js/desktop/src/env.ts index f5dbb8a5b..a94483571 100644 --- a/js/desktop/src/env.ts +++ b/js/desktop/src/env.ts @@ -20,11 +20,3 @@ export default function getEnv() { updateBaseUrl, }; } - -// This allows TypeScript to pick up the magic constants that's auto-generated by Forge's Webpack -// plugin that tells the Electron app where to look for the Webpack-bundled app code (depending on -// whether you're running in development or production). -declare const MAIN_WINDOW_WEBPACK_ENTRY: string; -declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string; - -export { MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY, MAIN_WINDOW_WEBPACK_ENTRY }; diff --git a/js/desktop/src/forge.d.ts b/js/desktop/src/forge.d.ts new file mode 100644 index 000000000..b8678fcbc --- /dev/null +++ b/js/desktop/src/forge.d.ts @@ -0,0 +1,6 @@ +// The entry points Forge's webpack plugin defines (DefinePlugin), by the +// bundle's location in development or production. DefinePlugin substitutes +// only where these names are used, so reference them directly: a module +// that re-exports one exports undefined. +declare const MAIN_WINDOW_WEBPACK_ENTRY: string; +declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string; diff --git a/js/desktop/src/tests/sync-test.ts b/js/desktop/src/tests/sync-test.ts index 67dc14e33..bb3b67e4f 100644 --- a/js/desktop/src/tests/sync-test.ts +++ b/js/desktop/src/tests/sync-test.ts @@ -1,6 +1,5 @@ import { BrowserWindow, session, WebFrameMain, webFrameMain } from "electron"; import { v7 as uuidv7 } from "uuid"; -import { MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY } from "../env"; import { E2ETest, TestEnv } from "./test-env"; import { delay, PlayerReport } from "./util"; diff --git a/js/desktop/src/window.ts b/js/desktop/src/window.ts index 601dfba57..9012a70c2 100644 --- a/js/desktop/src/window.ts +++ b/js/desktop/src/window.ts @@ -1,6 +1,6 @@ import { BrowserWindow, globalShortcut } from "electron"; import { resolve } from "path"; -import getEnv, { MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY } from "./env"; +import getEnv from "./env"; export const makeWindow = async (): Promise => { const { isDev } = getEnv();