🚀 Feature: Don't inline if doing so would increase code size #3
Labels
status: accepting prs
Please, send a pull request to resolve this! 🙏
type: feature
New enhancement or request 🚀
Bug Report Checklist
main
branch of the repository.Overview
For projects that are using ts-function-inliner primarily to reduce code size, it may be preferable to skip inlining functions if the replaced call would actually result in more output code. Especially if the function can't be removed (e.g. it's
export
ed) and/or is called in many places.Let's add an option to skip inlining a function in that case. I'm not sure what it should be called: maybe,
skipLargerReplacements: true
?Additional Info
For an example, take this function and two calls to it:
Code block character length: 100
By default, ts-function-inliner would produce:
Code block character length: 130
The text was updated successfully, but these errors were encountered: