-
Notifications
You must be signed in to change notification settings - Fork 35
fix: generate entry file on naming conflicts #1310
Conversation
⏱ Benchmark resultsComparing with ea4008e largeDepsEsbuild: 2.1s⬇️ 3.43% decrease vs. ea4008e
LegendlargeDepsNft: 7.4s⬇️ 9.24% decrease vs. ea4008e
LegendlargeDepsZisi: 14.7s⬇️ 5.49% decrease vs. ea4008e
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind adding a couple of examples to the PR description so that it's easier to understand what happens exactly in the cases we're targeting?
Done |
Agreed. Do we have an issue for tracking that work? If not, do you mind creating one? |
It is part of the notion doc about all the improvements for zip-it-and-ship-it. |
…-it#1310) Co-authored-by: Karin Hendrikse <30577427+khendrikse@users.noreply.github.com>
Summary
When a naming conflict occurs we need to create a entry file even if there is already a similar named file, but it will be moved to a subfolder.
Fixes the nuxt3 problem
when a functions has this layout
previously we would leave everything as is, as
server.js
is the main file and has the same name as the entry file so nothing to do.With #1190 we now consider
server.mjs
also as a potential entry file and detect that it can potentially conflict with the entry file, so we move everything from that function into a subfolder.when we do this we now need to generate an entry file again, even though we would detect that
server.js
would satisfy as entry-point, but due to everything being moved into a subfolder we need to.And the chain in this scenario is
./server.js -> ./src/server.js -> ./src/server.mjs
This is all not optimal, and we should prioritize changing the AWS entry point to something unique like
__netlifyLambdaEntry
and disallow a function to be named like that. Then all of this code can be removed.