-
Notifications
You must be signed in to change notification settings - Fork 21
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
Npm 7 workspace monorepo packaging #187
Comments
What does your serverless.yml look like and which directory are you running the |
Hey Ryan, I found a reasonable solution:
Ideally i'd like to namespace the I don't need that other branch I made where I changed the trace algo to track nested node_modules + symlinks. That was a suboptimal monorepo layout anyway, as it turns out. |
Glad you found a solution! Yeah, I think the root of the problem is maybe this: https://github.com/FormidableLabs/serverless-jetpack/#packaging-files-outside-cwd which is that a zip file considers CWD "the root" and just collapses everything else into place there. Typically this isn't too bad of a deal because of luck in how |
Hi. I know there's the open PR regarding lerna monorepos using symlinks (#142) but I'm currently working with a different arrangement which uses npm v7 workspaces, typescript project references, a flat directory structure and relative paths, e.g.:
Imports inside the handler, after compilation, look like
require("../../../common-a/dist/index")
. So, this is a path which escapes the confines of what serverless considers theservicePath
. When jetpack produces the zip, it all looks great, except the handler paths are missing the necessary parent segment ("function-1") to make that relative path work:I guess I'm looking for a way to say "prepend the function's file paths in the zip with 'function-1'". Is there any prior art in this sort of area?
Cheers!
The text was updated successfully, but these errors were encountered: