Skip to content

Commit

Permalink
remove getVercelOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy committed Jan 17, 2024
1 parent 3102556 commit 32b2288
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions packages/integrations/vercel/src/lib/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export async function getFilesFromFolder(dir: URL) {
return files;
}

export const getVercelOutput = (root: URL) => new URL('./.vercel/output/', root);

/**
* Copies files into a folder keeping the folder structure intact.
* The resulting file tree will start at the common ancestor.
Expand Down
8 changes: 4 additions & 4 deletions packages/integrations/vercel/src/static/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
type DevImageService,
type VercelImageConfig,
} from '../image/shared.js';
import { emptyDir, getVercelOutput, writeJson } from '../lib/fs.js';
import { emptyDir, writeJson } from '../lib/fs.js';
import { isServerLikeOutput } from '../lib/prerender.js';
import { getRedirects } from '../lib/redirects.js';
import {
Expand Down Expand Up @@ -79,7 +79,7 @@ export default function vercelStatic({
if (command === 'build' && speedInsights?.enabled) {
injectScript('page', 'import "@astrojs/vercel/speed-insights"');
}
const outDir = new URL('./static/', getVercelOutput(config.root));
const outDir = new URL('./.vercel/output/static', config.root);
updateConfig({
outDir,
build: {
Expand Down Expand Up @@ -110,12 +110,12 @@ export default function vercelStatic({
// Ensure to have `.vercel/output` empty.
// This is because, when building to static, outDir = .vercel/output/static/,
// so .vercel/output itself won't get cleaned.
await emptyDir(getVercelOutput(_config.root));
await emptyDir(new URL('./.vercel/output/', _config.root));
},
'astro:build:done': async ({ routes }) => {
// Output configuration
// https://vercel.com/docs/build-output-api/v3#build-output-configuration
await writeJson(new URL(`./config.json`, getVercelOutput(_config.root)), {
await writeJson(new URL('./.vercel/output/config.json', _config.root), {
version: 3,
routes: [
...getRedirects(routes, _config),
Expand Down

0 comments on commit 32b2288

Please sign in to comment.