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

fix(vite-plugin-vue-i18n): use correct id in hmr #160

Merged
merged 2 commits into from
Aug 10, 2022
Merged

fix(vite-plugin-vue-i18n): use correct id in hmr #160

merged 2 commits into from
Aug 10, 2022

Conversation

marekvospel
Copy link
Contributor

fixes #153

I haven't tested this, as I currently don't have access to my computer, nor github codespaces.

@marekvospel
Copy link
Contributor Author

According to @ghostiam's comment in #153, this should fix #153.

@c-harding
Copy link
Contributor

@ghostiam’s comment: #153 (comment)

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!
Welcome contribution!

LGTM!

@@ -210,7 +210,9 @@ function pluginI18n(
async handleHotUpdate({ file, server }) {
if (/\.(json5?|ya?ml)$/.test(file)) {
const module = server.moduleGraph.getModuleById(
INTLIFY_BUNDLE_IMPORT_ID
getVirtualId(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... I forgot that virtual id has been used in the plugin 😅

@kazupon
Copy link
Member

kazupon commented Aug 10, 2022

@marekvospel
Could you fix the lint error, please?

@c-harding
Copy link
Contributor

@kazupon this currently fails building. I would suggest you add a build stage to GitHub Actions (I’m happy to do so with a PR)

src/index.ts(213,11): error TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string'.
  Type 'null' is not assignable to type 'string'.

@marekvospel
Copy link
Contributor Author

I've fixed the lint problem & changed to the correct method, so build should pass

@kazupon
Copy link
Member

kazupon commented Aug 10, 2022

@marekvospel
Thanks!

@kazupon kazupon merged commit f82ce2c into intlify:main Aug 10, 2022
@marekvospel marekvospel deleted the fix-hmr branch August 10, 2022 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Live reloading translations is not working
3 participants