Skip to content
This repository was archived by the owner on Jul 4, 2021. It is now read-only.

Commit 1eab4de

Browse files
authored
fix HMR for Static bundle importing resources (#103)
1 parent e86f185 commit 1eab4de

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@ function pluginI18n(
137137
}
138138
},
139139

140+
async handleHotUpdate({ file, server }) {
141+
if (/\.(json5?|ya?ml)$/.test(file)) {
142+
const module = server.moduleGraph.getModuleById(
143+
INTLIFY_BUNDLE_IMPORT_ID
144+
)
145+
if (module) {
146+
server.moduleGraph.invalidateModule(module)
147+
return [module!]
148+
}
149+
}
150+
},
151+
140152
async transform(code: string, id: string) {
141153
const { filename, query } = parseVueRequest(id)
142154
debug('transform', id, JSON.stringify(query))

0 commit comments

Comments
 (0)