-
Notifications
You must be signed in to change notification settings - Fork 375
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
feat(solid-start-vercel): use @vercel/nft to include un-bundable dependancies #702
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to make working with absolute path easier i used URL objects.. for now i left in the equivalent |
Thank you so much. Very much appreciated. |
This was referenced Feb 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a companion/alternative for Vercel pr to #644. Discord discussion
Vercel functions expect all required files to be within the
*.func
folder while normally this is done automatically with the build process but some files can't be bundled notably prisma's*engine.node
andschema.prisma
filesin order to do this we use vercels nft (node file trace) package which is used is used internally by next. unlike next we can't just include a [file].js.nft.json file along side the handler due to it not being supported in their Build Output v3. So what we have to do is recreate the folder structure of the app from the root of the filesystem within the
.func
folder. astro does this to solve the same issueExample output
why from the root? its due to a limitation of
@vercel/nft
.@vercel/nft
will not return files that is outside of what you pass in as root which by default is the cwd. so if a package gets hoisted or files are included from a sibling package we can't copy itThe alternative to this would be to detect if we are inside a workspace and use the workspace root as the root directory only have to create the folder structure from there. But I haven't found a consistent way to determine the package root of an unknown package manager. and would also require keeping up with changes to how workspaces are handled in the future.
since we no longer output directly to
.vercel/output
for server build we can follow what other adapters do and output the result of the build todist
and then copy it inside.vercel/output/fucntions/[func].func/[workspacePath]