Skip to content

Commit 04ab50d

Browse files
committed
fix: enable HMR for additional translation paths
1 parent 758ddbf commit 04ab50d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function i18n(options: string | VitePluginOptionsInterface = 'lan
5454
files = generateFiles(langPath, langPaths)
5555
},
5656
handleHotUpdate(ctx) {
57-
if (/lang\/.*\.php$/.test(ctx.file)) {
57+
if ([langPath, ...additionalLangPaths].some(path => new RegExp(`${path}.*\\.php$`).test(ctx.file))) {
5858
const langPaths = prepareExtendedParsedLangFiles([frameworkLangPath, langPath, ...additionalLangPaths])
5959

6060
files = generateFiles(langPath, langPaths)

0 commit comments

Comments
 (0)