Skip to content

Commit

Permalink
fix(deno): safely set external specifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy committed Sep 23, 2023
1 parent 4c4ad9d commit 75aa446
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-dryers-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/deno': patch
---

Fixed an issue where deno integration broke some frameworks.
9 changes: 6 additions & 3 deletions packages/integrations/deno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ export default function createIntegration(args?: Options): AstroIntegration {
`[@astrojs/deno] Otherwise, this adapter is not required to deploy a static site to Deno.`
);
}

},
'astro:config:setup' ({ updateConfig }) {
updateConfig({
vite: { ssr: { noExternal: COMPATIBLE_NODE_MODULES } }
})
},
'astro:build:setup': ({ vite, target }) => {
if (target === 'server') {
Expand All @@ -149,9 +155,6 @@ export default function createIntegration(args?: Options): AstroIntegration {
(vite.resolve.alias as Record<string, string>)[alias.find] = alias.replacement;
}
}
vite.ssr = {
noExternal: COMPATIBLE_NODE_MODULES,
};

if (Array.isArray(vite.build.rollupOptions.external)) {
vite.build.rollupOptions.external.push(DENO_IMPORTS_SHIM);
Expand Down

0 comments on commit 75aa446

Please sign in to comment.