diff --git a/forge/app.config.ts b/forge/app.config.ts index 93fc5012..c8361ff7 100644 --- a/forge/app.config.ts +++ b/forge/app.config.ts @@ -116,8 +116,11 @@ process.on("exit", () => { fs.writeFileSync(configPath, JSON.stringify(data, null, 2)); // TODO: This is hack to make `@azure/identity` place nice on Edge. It will without a doubt break the sourcemap. - fs.appendFileSync( + const code = fs.readFileSync( + path.join(basePath, "functions", "__nitro.func", "index.mjs") + ); + fs.writeFileSync( path.join(basePath, "functions", "__nitro.func", "index.mjs"), - "global = {};" + `global = {};${code}` ); }); diff --git a/forge/vite.config.ts b/forge/vite.config.ts index b22736e0..893fded6 100644 --- a/forge/vite.config.ts +++ b/forge/vite.config.ts @@ -57,9 +57,4 @@ export default defineConfig((config) => ({ ssr: { noExternal: ["@kobalte/core"], }, - define: { - // By default, Vite doesn't include shims for NodeJS/ - // necessary for segment analytics lib to work - global: {}, - }, }));