Skip to content

Commit

Permalink
fix(#5723): build prerendered pages with Netlify edge functions
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Jan 17, 2023
1 parent 28556a8 commit 86ffb0a
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions packages/integrations/netlify/src/integration-edge-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,6 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
name: '@astrojs/netlify/edge-functions',
hooks: {
'astro:config:setup': ({ config, updateConfig }) => {
// Add a plugin that shims the global environment.
const injectPlugin: VitePlugin = {
name: '@astrojs/netlify/plugin-inject',
generateBundle(_options, bundle) {
if (_buildConfig.serverEntry in bundle) {
const chunk = bundle[_buildConfig.serverEntry];
if (chunk && chunk.type === 'chunk') {
chunk.code = `globalThis.process = { argv: [], env: {}, };${chunk.code}`;
}
}
},
};
const outDir = dist ?? new URL('./dist/', config.root);
updateConfig({
outDir,
Expand All @@ -137,9 +125,6 @@ export function netlifyEdgeFunctions({ dist }: NetlifyEdgeFunctionsOptions = {})
server: new URL('./.netlify/edge-functions/', config.root),
serverEntry: 'entry.js',
},
vite: {
plugins: [injectPlugin],
},
});
},
'astro:config:done': ({ config, setAdapter }) => {
Expand Down

0 comments on commit 86ffb0a

Please sign in to comment.