-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Extra file (package.json) not included into final zips #315
Comments
Ok, I started to look through the code after reporting the issue and I think I found it.
What's the reasoning behind this? @floydspace So I can make some PR, but question - do we want this default or can we just remove it? If somebody wants to exclude any of the 4 then he can simply add some pattern themselves. If you don't want to do such then it'll require creating some additional option probably. |
hi @doteric , to be honest, not sure what is the reason we exclude, maybe because anyway we deliver bundled code and |
Hey @floydspace, thanks for the reply. |
@doteric yes, you're absolutely right, only external modules, here is the thing, other dependencies are bundled and you don't need them in generated package.json. so your assumption is correct, but could be vice versa, some of the params from base package.json would be copied to generated one, because you probably do not need |
@doteric Lambda relies on the package file or the file extension, so you could do something like this in your serverless.yml:
Ref: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html |
BTW, getting the
|
Thanks @mpaleo for the suggestion. Anyway regarding this case I've decided to not use |
🎉 This issue has been resolved in version 1.32.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Describe the bug
Extra files (package.json to be exact) are not included into the final zips.
Versions (please complete the following information):
Additional context
So basically I wanted to use esbuild with ESM (AWS supports this for a while already). I set the
type
inside package.json tomodule
and everything else needed for this move, worked fine, but the problem I stumbled upon is that serverless-esbuild simply does not include thepackage.json
into the zip even if it's added to thepackage.patterns
like so below.It looks like the
.esbuild
contains the thepackage.json
, but the zips themselves don't.Of course I could just name my files
.mjs
instead, but that isn't an ideal solution for me.The text was updated successfully, but these errors were encountered: