Skip to content

Commit 57d6d7d

Browse files
committed
fix hot-reload for vue files with the same name
1 parent 322cf4d commit 57d6d7d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,14 @@ module.exports = function (content) {
214214
process.env.NODE_ENV !== 'production' &&
215215
(parts.script.length || parts.template.length)
216216
) {
217+
var hotId = JSON.stringify(moduleId + '/' + fileName)
217218
output +=
218219
'if (module.hot) {(function () {' +
219220
' module.hot.accept()\n' +
220221
' var hotAPI = require("vue-hot-reload-api")\n' +
221222
' hotAPI.install(require("vue"), false)\n' +
222223
' if (!hotAPI.compatible) return\n' +
223-
' var id = ' + loaderUtils.stringifyRequest(loaderContext, filePath) + '\n' +
224+
' var id = ' + hotId + '\n' +
224225
' if (!module.hot.data) {\n' +
225226
// initial insert
226227
' hotAPI.createRecord(id, module.exports)\n' +

0 commit comments

Comments
 (0)