-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(astro): Configure default sourcemap assets glob for Vercel adapter #9665
Conversation
c580cd2
to
0303ac4
Compare
size-limit report 📦
|
// only copied over to <root>/.vercel. This seems to happen too late though. | ||
// So we glob on both of these directories. | ||
// Another case of "it ain't pretty but it works":( | ||
if (config.adapter && config.adapter.name?.startsWith('@astrojs/vercel')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (config.adapter && config.adapter.name?.startsWith('@astrojs/vercel')) { | |
if (config.adapter?.name?.startsWith('@astrojs/vercel')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, good catch, just saw it too late. Will sneak your suggestion into #9668
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds support for uploading sourcemaps when using the
@astrojs/vercel/*
adapters.It seems that the adapter updates the config.outdir value too late for our previous detection logic to
correctly detect the .vercel output directory. Furthermore, the adapter for some reason first saves server
files to /dist only to copy it later to /.vercel/functions. This copy command seems to happen too
late for when our sourcemaps plugin runs.
For these two reasons, we try to detect the used adapter (love that this is much simpler in Astro than
Sveltekit) and adjust the assets glob to search for files in both,
dist
and.vercel
.Tested this for client side (island) and server-side errors with a test app deployed to vercel (serverless, not
edge) and it seems to work well.
Note: I'll open a separate PR for users to specify a custom assets glob for more advanced setups.
closes #9591