-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Package individually doesn't optimise package size #79
Comments
Hey @PatrykMilewski, thank you for using the plugin. |
@floydspace Thanks! Could you share some more details? Maybe I could fix it myself and create a PR? |
@PatrykMilewski the issue is that serverless by default packs everything that is in the |
Thank you for this package @floydspace. I am experiencing the same problem with |
My workaround is to use the functions:
MyAPI:
handler: src/core/my/handler.api
package:
include:
- '!**'
- 'src/core/my/**'
TheirAPI:
handler: src/core/their/handler.api
package:
include:
- '!**'
- 'src/core/their/**' I don't have to do this with |
@dashmug Should work, but it's kinda annoying and might cause problems, like you use some common files and then you forgot to include them. Using serverless-webpack solves the problem? But then isn't it slowing down the whole build? It ruins all of the benefits of quick build of ESBuild, isn't it? |
@PatrykMilewski I'm only reporting my current workaround in the hopes that it can help someone. It is indeed annoying to have to exclude/include them explicitly. I didn't need to do that with my other project using I'm hoping the same functionality can make its way here in |
Hoping for this feature as well, any updates on it ? |
Sorry guys, don't have time to focus on this issue. |
I think this issue is something related to my issue: |
@dashmug and @PatrykMilewski I have added a PR to optimize individual packaging: #87 |
Sure! I will give it a try today or tomorrow, thank you! |
🎉 This issue has been resolved in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I just tested it and it works great! Thank you @olup for fixing this issue! |
Hello!
This plugin works great, thank you for sharing it!
I wanted to test, if it works for our use case and I've found some problems.
We are using Yarn as package manager with workspaces enabled. In the stack that I'm testing, we are having 4 lambda functions. When I was using Webpack, each lambda had different package size, where the smallest was 1.5 MB and the biggest was 3 MB.
However when I was experimenting with this plugin, it looks like, package individually option doesn't work. The package size is 6 MB for each lambda, which equals the size of package, that is created when package individually is disabled.
I was looking a little bit into the source code and it looks like, package individually option is handled by this plugin. Is this expected behaviour of esbuild? This is the config that I'm using:
Versions:
"serverless-esbuild": "1.5.1"
"serverless": "2.3.0"
Node.js v12.19.1
The text was updated successfully, but these errors were encountered: