Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(vercel): Build Output API v3 #3216

Merged
merged 45 commits into from
May 11, 2022
Merged

Conversation

JuanM04
Copy link
Contributor

@JuanM04 JuanM04 commented Apr 27, 2022

Changes

Now with Build Output API (v3)!

  • Multiple deploy targets: edge, serverless and static.
  • When building to serverless, the code isn't transpiled to CJS anymore.
  • Meta: removed .output/ from gitignores

The users that migrate from v0.1 will have to do this:

  1. Change the import inside astro.config.mjs:
    - import vercel from '@astrojs/vercel'
    + import vercel from '@astrojs/vercel/serverless'
  2. Rename the ENABLE_FILE_SYSTEM_API environment variable to ENABLE_VC_BUILD, as Vercel changed it.
  3. The output folder changed from .output to .vercel/output — you may need to update your .gitignore.

Testing

Docs

@changeset-bot
Copy link

changeset-bot bot commented Apr 27, 2022

🦋 Changeset detected

Latest commit: 7a20b3b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/vercel Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Apr 27, 2022
@JuanM04 JuanM04 requested a review from matthewp April 29, 2022 23:30
@TooTallNate
Copy link

This is very cool! I'd love to test it out. Can you add testing instructions?

Also, if you have any questions and/or feedback regarding the new Build Output API, we'd love to hear from you over here.

Cheers!

@JuanM04
Copy link
Contributor Author

JuanM04 commented May 3, 2022

@TooTallNate Thank you! I've been doing the following:

  1. Clone this branch and run pnpm install && pnpm build
  2. Clone one of the Astro starters (you can use pnpm create astro)
  3. In the new project, add the local Vercel integration (pnpm add -D @astrojs/vercel@link:~/path/to/astro/packages/integrations/vercel)
  4. Follow the instructions in the integration README
  5. Deploy to Vercel with
    ENABLE_VC_BUILD=1 astro build
    vercel deploy --prebuilt

@TooTallNate
Copy link

Worked great for me 😄 https://my-astro-site-4nt1lu3gs-tootallnate.vercel.app/

@JuanM04 JuanM04 marked this pull request as draft May 5, 2022 12:36
@JuanM04 JuanM04 marked this pull request as ready for review May 5, 2022 20:07
@JuanM04
Copy link
Contributor Author

JuanM04 commented May 11, 2022

Just as a note, this new version of the adapter fixes problems with Prisma: https://discord.com/channels/830184174198718474/845451724738265138/973950046531883048

@matthewp matthewp merged commit 114bf63 into main May 11, 2022
@matthewp matthewp deleted the juanm04/vercel-build-output-api branch May 11, 2022 21:10
@github-actions github-actions bot mentioned this pull request May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants