Conversation
| const buildInfo = { | ||
| date: new Date(), | ||
| preset: nitro.options.preset, | ||
| entry: nitro.options.entry.split("/").pop(), |
There was a problem hiding this comment.
This is the source entry name not a build output information...
There was a problem hiding this comment.
Yes, this is useful for presets like firebase, where one preset can have multiple entries :
ie looking at the build output of a firebase preset build, we can't know if firebase-gen-1 or firebase-gen-2 is being used.
There was a problem hiding this comment.
I know that's a valid case but generally it doesn't seems to be best idea to add source entry to production info. It can be implemented per preset imo.
There was a problem hiding this comment.
That's a good point, what about renaming the preset if it's firebase with a hook? Something like firebase_${variant} ?
There was a problem hiding this comment.
Renaming the user-input preset can also lead to more confusing behavior.
|
Thanks for the PR @Hebilicious. I guess i would prefer to use current method for firebase preset at least to keep the preset implementations simplicity and decoupled as much as possible. While current approach for firebase gen handling is not perfect, i am happy to discuss about some other alternative ideas once we migrated repo to a monorepo. Also we can use virtual chunks for entry or simply support dynamic entry based on user input config (it was absence by the time of implementing that PR...) |
🔗 Linked issue
resolves #1650
❓ Type of change
📚 Description
While working on #1557, I noticed that for presets that can have multiple entries, like firebase, there's no straightforward way to identify which one has been used. This adds a reference to the preset used in the build info.
📝 Checklist