Comments (14)
I just tested it and it works great! Thank you @olup for fixing this issue!
from serverless-esbuild.
My workaround is to use the include
.
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 serverless-webpack
.
from serverless-esbuild.
I think this issue is something related to my issue:
from serverless-esbuild.
@dashmug and @PatrykMilewski I have added a PR to optimize individual packaging: #87
I'd love to have your input on this ; if this is working with your repo, use cases, etc... Could you give it a try ?
from serverless-esbuild.
🎉 This issue has been resolved in version 1.8.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from serverless-esbuild.
Hey @PatrykMilewski, thank you for using the plugin.
Indeed, I was able to reproduce. It's handled, but halfway. so it does not work properly now.
Will work on the fix as soon as I have time.
from serverless-esbuild.
@floydspace Thanks! Could you share some more details? Maybe I could fix it myself and create a PR?
from serverless-esbuild.
@PatrykMilewski the issue is that serverless by default packs everything that is in the this.serverless.config.servicePath
folder, I replace this folder to .build
one as all compiled artifacts are stored there during the compilation. But seems like we have to prepare artifacts for each lambda manually, so compile, zip it, and provide the archive as lambda artifact. the implementation by serverless-webpack
could work, see: packageModules.js#L73
from serverless-esbuild.
Thank you for this package @floydspace. I am experiencing the same problem with v1.6.0
.
from serverless-esbuild.
@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?
from serverless-esbuild.
@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 serverless-webpack
and I get optimised packages per function.
I'm hoping the same functionality can make its way here in serverless-esbuild
as well.
from serverless-esbuild.
Hoping for this feature as well, any updates on it ?
from serverless-esbuild.
Sorry guys, don't have time to focus on this issue.
If you want to use serverless-webpack
as workaround I would suggest you use it in pair with esbuild-loader
, so you would have the same fast build benefit
from serverless-esbuild.
@dashmug and @PatrykMilewski I have added a PR to optimize individual packaging: #87
I'd love to have your input on this ; if this is working with your repo, use cases, etc... Could you give it a try ?
Sure! I will give it a try today or tomorrow, thank you!
from serverless-esbuild.
Related Issues (20)
- Non-root dependency of external package gets filtered out by bundleDeps AST check
- Install issue
- Does serverless-esbuild support ESM/ES Modules? HOT 3
- Externals packaging prioritises yarn.lock lookup HOT 3
- pkg?.context is not a function after 491 and 492 commits HOT 2
- slow performance when creating multiple zip files. HOT 1
- Plugin page on serverless.com is outdated HOT 3
- Unable to import native nodejs modules using ESM modules
- exclude is broken HOT 1
- serverless website documentation is outdated HOT 1
- Bun support HOT 1
- Unable to serverless package when no lambdas exist HOT 3
- serverless deploy fails without a reason when using esbuild-plugin-tsc HOT 2
- Rewrite Module Packaging Logic HOT 3
- I'm not sure if it supports layers
- pnpm: external modules bundled without their nested modules. HOT 2
- Indirect dependency marked as external missing in package HOT 1
- Slow performance when using external property
- Esbuild cannot rebuild error
- `patterns` not respected at `invoke local`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-esbuild.