Skip to content

Commit

Permalink
Merge branch 'main' into feat/vercel-include-files
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanM04 committed Oct 14, 2022
2 parents 890f9ec + f8198d2 commit 3f943d6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-baboons-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix `astro add` trying to add lines from extended configurations when adding frameworks
5 changes: 5 additions & 0 deletions .changeset/hot-dogs-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': minor
---

Minify Edge Function output to save space
5 changes: 5 additions & 0 deletions .changeset/neat-phones-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/react': patch
---

Add `@types/` packages as peerDependencies
2 changes: 2 additions & 0 deletions packages/astro/src/core/config/tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function loadTSConfig(cwd: string | undefined, resolve = true): tsr.TsCon
let config = tsr.tsconfigResolverSync({
cwd,
filePath: resolve ? undefined : cwd,
ignoreExtends: !resolve,
});

// When a direct filepath is provided to `tsconfigResolver`, it'll instead return invalid-config even when
Expand All @@ -70,6 +71,7 @@ export function loadTSConfig(cwd: string | undefined, resolve = true): tsr.TsCon
cwd,
filePath: resolve ? undefined : cwd,
searchName: 'jsconfig.json',
ignoreExtends: !resolve,
});

if (
Expand Down
3 changes: 2 additions & 1 deletion packages/integrations/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"peerDependencies": {
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0",
"@types/react": "^17.0.50 || ^18.0.21"
"@types/react": "^17.0.50 || ^18.0.21",
"@types/react-dom": "^17.0.17 || ^18.0.6"
},
"engines": {
"node": "^14.18.0 || >=16.12.0"
Expand Down
11 changes: 11 additions & 0 deletions packages/integrations/vercel/src/edge/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ export default function vercelEdge({ includeFiles = [] }: VercelEdgeConfig = {})
buildTempFolder = config.build.server;
functionFolder = new URL('./functions/render.func/', config.outDir);
serverEntry = config.build.serverEntry;
functionFolder = config.build.server;

if (config.output === 'static') {
throw new Error(`
[@astrojs/vercel] \`output: "server"\` is required to use the edge adapter.
`);
}
},
'astro:build:start': ({ buildConfig }) => {
if (needsBuildConfig) {
Expand Down Expand Up @@ -74,6 +82,9 @@ export default function vercelEdge({ includeFiles = [] }: VercelEdgeConfig = {})
target: 'webworker',
noExternal: true,
};

vite.build ||= {};
vite.build.minify = true;
}
},
'astro:build:done': async ({ routes }) => {
Expand Down

0 comments on commit 3f943d6

Please sign in to comment.