Minimal bundle luaLibImport option#1383
Merged
Perryvw merged 6 commits intoTypeScriptToLua:masterfrom Jan 15, 2023
Merged
Conversation
Contributor
|
is it expensive? if not, then should we have it turned on unconditionally? |
Member
Omitting part of the lualib has a higher chance of breaking things and causing runtime errors, especially with external Lua. Maybe after a while we can make this the default, but for now I think this is correct as opt-in. |
Perryvw
reviewed
Jan 14, 2023
src/LuaLib.ts
Outdated
| emitHost: EmitHost, | ||
| exportName: string | ||
| ): LuaLibFeature | undefined { | ||
| const luaLibPath = resolveLuaLibDir(luaTarget); |
Member
There was a problem hiding this comment.
Isn't this always the same within a project? Does this actually do anything?
Contributor
|
@GlassBricks It needs to be added to the webpage too: https://typescripttolua.github.io/docs/configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the option "require-minimal" to luaLibImport.
With this, the emitted
lualib_bundle.luaonly contains used features.This does a text search on all resolved (lua) files to determine which lualib features were used, so that projects which import lua libraries using lualib features still work.