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: translation key tree-shaking for Vite #207

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Majkie
Copy link
Contributor

@Majkie Majkie commented Mar 29, 2025

Solves #185

Also fixes TS in loader.ts

Added logic to extract and filter used translation keys during the build process using AST parsing for Vue templates and script blocks. Updated `generateFiles` to exclude unused keys, improving build efficiency and output size. Included tests to verify key extraction and filtering functionality.
@xiCO2k
Copy link
Owner

xiCO2k commented Mar 29, 2025

Thanks, for that can you add a flag to apply that or not?

Introduced a `treeShake` option to optimize the plugin by removing unused translations. Updated relevant logic to respect the `treeShake` setting and added tests to validate the new behavior.
@Majkie
Copy link
Contributor Author

Majkie commented Apr 4, 2025

Thanks, for that can you add a flag to apply that or not?

Done! Let me know if anything else needs to be done. Thanks!

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.

2 participants