-
Notifications
You must be signed in to change notification settings - Fork 699
Labels
Description
What problem does this feature solve?
The current optimization.inlineConst option only takes false or true, which is difficult to use as a default for rolldown-vite as true may generate a bigger bundle.
Having an option that will reduce the bundle size in most cases would help for that. I think it's ok to have some cases being bigger.
Some ways I can think of are:
- inline based on some conditions like Oxc's minifier does
- actually try inlining it and check the length somehow
or maybe only handle the value duplication on Rolldown side and let the minifier inlinine the values (#4246 (comment))
What does the proposed API look like?
Change optimization.inlineConst to receive 'safe' as well.
(Maybe it should be a different name than 'safe')
Reactions are currently unavailable