@@ -60,6 +60,10 @@ compiler.applyConfig = function (config) {
60
60
}
61
61
62
62
compiler . compile = function ( content , filePath , cb ) {
63
+ var isProduction = process . env . NODE_ENV === 'production'
64
+ var isServer = process . env . VUE_ENV === 'server'
65
+ var isTest = ! ! process . env . VUEIFY_TEST
66
+
63
67
// generate css scope id
64
68
var id = 'data-v-' + genId ( filePath )
65
69
// parse the component into parts
@@ -96,7 +100,7 @@ compiler.compile = function (content, filePath, cb) {
96
100
var map = null
97
101
// styles
98
102
var style = resolvedParts . styles . join ( '\n' )
99
- if ( style ) {
103
+ if ( style && ! isServer ) {
100
104
// emit style
101
105
compiler . emit ( 'style' , {
102
106
file : filePath ,
@@ -126,7 +130,7 @@ compiler.compile = function (content, filePath, cb) {
126
130
// template
127
131
var template = resolvedParts . template
128
132
if ( template ) {
129
- if ( process . env . NODE_ENV !== 'production' ) {
133
+ if ( ! isProduction && ! isServer ) {
130
134
output +=
131
135
'if (__vue__options__.functional) {console.error("' +
132
136
'[vueify] functional components are not supported and ' +
@@ -142,7 +146,7 @@ compiler.compile = function (content, filePath, cb) {
142
146
output += '__vue__options__._scopeId = "' + id + '"\n'
143
147
}
144
148
// hot reload
145
- if ( process . env . NODE_ENV !== 'production' && ! process . env . VUEIFY_TEST ) {
149
+ if ( ! isProduction && ! isTest && ! isServer ) {
146
150
output +=
147
151
'if (module.hot) {(function () {' +
148
152
' var hotAPI = require("' + hotReloadAPIPath + '")\n' +
0 commit comments