Skip to content

Commit

Permalink
fix: page not updated on changing lazy locale files (dev mode)
Browse files Browse the repository at this point in the history
Resolves #905
  • Loading branch information
rchl committed Mar 11, 2021
1 parent 2523787 commit 257654e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/templates/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export async function loadLanguageAsync (context, locale) {
const { nuxtState } = context
if (nuxtState && nuxtState.__i18n && nuxtState.__i18n.langs[locale]) {
messages = nuxtState.__i18n.langs[locale]
// Even if already cached in Nuxt state, trigger locale import so that HMR kicks-in on changes to that file.
if (context.isDev) {
ASYNC_LOCALES[file]()
}
}
}
if (!messages) {
Expand Down

0 comments on commit 257654e

Please sign in to comment.