Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace dynamic import extensions at compile-time + fix: avoid duplicate injections #9

Merged
merged 3 commits into from Jan 6, 2024

Conversation

aminya
Copy link
Contributor

@aminya aminya commented Oct 15, 2023

  • If the dynamic import is a string literal with a constant extension, its path is replaced at compile-time instead of injecting code.
  • Now, the __transformExtension function is only injected once for multiple dynamic imports.

These two features reduce the output size significantly for dynamic imports.

Fixes #8

If the dynamic import is a string literal with a constant extension, its path is replaced at compile-time instead of injecting code.
@aminya aminya changed the title feat: replace dynamic import extensions at compile-time feat: replace dynamic import extensions at compile-time + fix: avoid duplicate __transformExtension injections Oct 15, 2023
@aminya aminya changed the title feat: replace dynamic import extensions at compile-time + fix: avoid duplicate __transformExtension injections feat: replace dynamic import extensions at compile-time + fix: avoid duplicate injections Oct 15, 2023
@aminya
Copy link
Contributor Author

aminya commented Jan 3, 2024

@silane Could you take a look?

@silane silane merged commit a6a0d34 into silane:master Jan 6, 2024
@silane
Copy link
Owner

silane commented Jan 6, 2024

@aminya
Sorry for late response.
I've merged and release it as v1.1.4. Thank you.

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.

transformExtension function is copied for each dynamic import
2 participants