Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Commit 17523ab

Browse files
committed
avoid exposiing full paths in compiled code
1 parent b2bc45a commit 17523ab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/compiler.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,9 @@ compiler.compile = function (content, filePath, cb) {
136136
output +=
137137
'if (module.hot) {(function () {' +
138138
' module.hot.accept()\n' +
139-
' var hotAPI = require(' + JSON.stringify(require.resolve('vue-hot-reload-api')) + ')\n' +
139+
' var hotAPI = require("vueify/node_modules/vue-hot-reload-api")\n' +
140140
' hotAPI.install(require("vue"), true)\n' +
141141
' if (!hotAPI.compatible) return\n' +
142-
' var id = ' + JSON.stringify(filePath) + '\n' +
143142
// remove style tag on dispose
144143
(style
145144
? ' module.hot.dispose(function () {\n' +
@@ -150,10 +149,10 @@ compiler.compile = function (content, filePath, cb) {
150149
) +
151150
' if (!module.hot.data) {\n' +
152151
// initial insert
153-
' hotAPI.createRecord(id, module.exports)\n' +
152+
' hotAPI.createRecord("' + id + '", module.exports)\n' +
154153
' } else {\n' +
155154
// update
156-
' hotAPI.update(id, module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template)\n' +
155+
' hotAPI.update("' + id + '", module.exports, (typeof module.exports === "function" ? module.exports.options : module.exports).template)\n' +
157156
' }\n' +
158157
'})()}'
159158
}

0 commit comments

Comments
 (0)