Skip to content

Commit 4acd553

Browse files
committed
avoid including hot-reload code for server build (fix vuejs#280)
1 parent 635560f commit 4acd553

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/template-compiler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function rewrite (attr) {
2929

3030
module.exports = function (html) {
3131
this.cacheable()
32+
var isServer = this.options.target === 'node'
3233
var compiled = compiler.compile(html, options)
3334
var code
3435
if (compiled.errors.length) {
@@ -44,7 +45,8 @@ module.exports = function (html) {
4445
'}'
4546
}
4647
// hot-reload
47-
if (!this.minimize &&
48+
if (!isServer &&
49+
!this.minimize &&
4850
process.env.NODE_ENV !== 'production') {
4951
var moduleId = loaderUtils.parseQuery(this.query).id
5052
code +=

0 commit comments

Comments
 (0)