Skip to content

Commit 162a21f

Browse files
committed
fix: only inject hmrId when HMR is enabled
1 parent 899080a commit 162a21f

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

Diff for: src/hotReload.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export function genHotReloadCode(
77
return `
88
/* hot reload */
99
if (module.hot) {
10+
script.__hmrId = "${id}"
1011
const api = __VUE_HMR_RUNTIME__
1112
module.hot.accept()
1213
if (!api.createRecord('${id}', script)) {

Diff for: src/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ const loader: webpack.loader.Loader = function(source: string) {
184184
}
185185

186186
if (needsHotReload) {
187-
code += `\nscript.__hmrId = "${id}"`
188187
code += genHotReloadCode(id, templateRequest)
189188
}
190189

0 commit comments

Comments
 (0)