Skip to content

Commit fd2f3ad

Browse files
committed
make ssr version take current context via argument
1 parent 9799418 commit fd2f3ad

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ module.exports.pitch = function (remainingRequest) {
5959
return shared.concat([
6060
'// add CSS to SSR context',
6161
'var add = require(' + addStylesServerPath + ')',
62-
'module.exports.__inject__ = function () {',
63-
' add(' + id + ', content, ' + isProduction + ')',
62+
'module.exports.__inject__ = function (context) {',
63+
' add(' + id + ', content, ' + isProduction + ', context)',
6464
'};'
6565
]).join('\n')
6666
}

lib/addStylesServer.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
var listToStyles = require('./listToStyles')
22

3-
module.exports = function (parentId, list, isProduction) {
4-
if (typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
5-
var context = __VUE_SSR_CONTEXT__
3+
module.exports = function (parentId, list, isProduction, context) {
4+
if (context) {
65
var styles = context._styles
76

87
if (!styles) {

0 commit comments

Comments
 (0)