Skip to content

Fix bundle modules executing twice if they have no imports or exports#1559

Merged
Perryvw merged 1 commit intomasterfrom
fix-one-file-bundle
Jun 14, 2024
Merged

Fix bundle modules executing twice if they have no imports or exports#1559
Perryvw merged 1 commit intomasterfrom
fix-one-file-bundle

Conversation

@Perryvw
Copy link
Member

@Perryvw Perryvw commented Jun 9, 2024

We were using the ternary shorthand in Lua X and Y or Z, but the problem is that if the loaded module Y is not actually a module (ie it has no imports or exports), it does not return an exports table, causing Z to also be executed.

Fixed this by using a regular if statement

Fixes #1558

@Perryvw Perryvw merged commit 5001dd8 into master Jun 14, 2024
@Perryvw Perryvw deleted the fix-one-file-bundle branch June 14, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using the luaBundle option with a single Typescript file causes your code to run twice.

1 participant