Fix HMR issues and add Vite 6 compatibility #4
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 pull request introduces compatibility with Vite 6, updates dependencies, and improves code consistency and maintainability. The most significant changes include upgrading dependencies, refactoring the plugin to align with Vite 6's API, and improving code formatting and organization.
Vite 6 Compatibility
vitedependency to version^6.0.0and adjusted peer dependencies to require Vite>=6. (package.json: package.jsonL71-R78)handleHotUpdatemethod to align with Vite 6's recommendation of returningvoidfor async operations that don't affect modules immediately. (src/index.ts: src/index.tsL14-R90)optimizeDepsconfiguration in the E2E test Vite config for better dependency optimization in Vite 6. (tests/e2e/app/vite.config.ts: tests/e2e/app/vite.config.tsL20-R32)vite.config.tsto targetes2020for modern browser compatibility. (vite.config.ts: vite.config.tsL1-R45)Dependency Updates
@vitejs/plugin-reactfrom^4.3.1to^4.2.1to ensure compatibility with the updated Vite version. (package.json: package.jsonL58-R58)vite-plugin-static-copyto version^2.0.0for compatibility with Vite 6. (package.json: package.jsonL71-R78)Code Refactoring and Formatting
src/index.ts: [1]tests/e2e/app/vite.config.ts: [2]vite.config.ts: [3]handleFileChangefunction tohandleTranslationFileChangeand extractedisFileInLangPathfor improved clarity and modularity. (src/index.ts: src/index.tsL14-R90)Documentation
README.mdto mention compatibility with Vite 6. (README.md: README.mdR22)These changes ensure the plugin is fully compatible with Vite 6 while improving code quality and maintainability.
Closes #3