Skip to content

Commit

Permalink
fixes vue
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderniebuhr committed Mar 29, 2024
1 parent 38da2ca commit d72b318
Show file tree
Hide file tree
Showing 4 changed files with 1,299 additions and 1,942 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-cooks-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/cloudflare': patch
---

fixes an issue where projects using `@astrojs/vue` were unusable, due to marking dependencies as external
2 changes: 1 addition & 1 deletion packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"miniflare": "^3.20240320.0",
"esbuild": "^0.19.5",
"tiny-glob": "^0.2.9",
"wrangler": "^3.36.0"
"wrangler": "^3.39.0"
},
"peerDependencies": {
"astro": "^4.2.0"
Expand Down
9 changes: 8 additions & 1 deletion packages/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,14 @@ export default function createIntegration(args?: Options): AstroIntegration {
vite.ssr ||= {};
vite.ssr.target = 'webworker';
vite.ssr.noExternal = true;
vite.ssr.external = _config.vite.ssr?.external ?? [];

if (typeof _config.vite.ssr?.external === 'undefined') vite.ssr.external = [];
if (typeof _config.vite.ssr?.external === 'boolean')
vite.ssr.external = _config.vite.ssr?.external;
if (Array.isArray(_config.vite.ssr?.external))
vite.ssr.external = _config.vite.ssr?.external.filter(
(entry) => entry !== '@vue/server-renderer'
);

vite.build ||= {};
vite.build.rollupOptions ||= {};
Expand Down
Loading

0 comments on commit d72b318

Please sign in to comment.