@@ -30,7 +30,7 @@ module.exports = function assemble (source, filename, config) {
30
30
shortFilePath : filename ,
31
31
require : {
32
32
vueHotReloadAPI : 'vue-hot-reload-api' ,
33
- normalizeComponent : 'vue-component-compiler/src/normalize-component.js'
33
+ normalizeComponent : 'vue-component-compiler/src/runtime/ normalize-component.js'
34
34
} ,
35
35
scopeId : null ,
36
36
moduleIdentifier : config . moduleIdentifier || hash ( _s ( { filename, config } ) ) , // require for server. TODO: verify this is correct.
@@ -61,14 +61,14 @@ module.exports = function assemble (source, filename, config) {
61
61
const IMPORT_NAME = `__vue_style_${ i } __`
62
62
const IMPORT_STRING = _s ( style . id )
63
63
const moduleName = ( style . descriptor . module === true ) ? '$style' : style . descriptor . module
64
- const needsStyleInjection = config . isServer && config . hasStyleInjectFn
64
+ const needsStyleInjection = config . hasStyleInjectFn
65
65
const needsNamedImport = needsStyleInjection || typeof moduleName === 'string'
66
66
const runInjection = needsStyleInjection ? `${ IMPORT_NAME } && ${ IMPORT_NAME } .__inject__ && ${ IMPORT_NAME } .__inject__(ssrContext)\n` : ''
67
67
68
68
if ( needsNamedImport ) {
69
69
output += config . esModule
70
70
? `import ${ IMPORT_NAME } from ${ IMPORT_STRING } \n`
71
- : `const ${ IMPORT_NAME } = requrie (${ IMPORT_STRING } )\n`
71
+ : `const ${ IMPORT_NAME } = require (${ IMPORT_STRING } )\n`
72
72
} else {
73
73
output += config . esModule
74
74
? `import ${ IMPORT_STRING } \n`
@@ -114,6 +114,7 @@ module.exports = function assemble (source, filename, config) {
114
114
}
115
115
}
116
116
} else {
117
+ styleInjectionCode += runInjection
117
118
}
118
119
} )
119
120
output += `function ${ INJECT_STYLE_FN } (ssrContext) {\n` + pad ( styleInjectionCode ) + `}\n`
0 commit comments