Skip to content

Commit

Permalink
feat: add support for SSR style injection
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbaron committed Jul 15, 2020
1 parent 0a9b39d commit 6694f47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function injectStylesSSR (imports) {

if (styles.size) {
return `
if (process.server) {
if (process.env.VUE_ENV === 'server') {
const options = typeof component.exports === 'function'
? component.exports.extendOptions
: component.options
Expand Down Expand Up @@ -140,7 +140,7 @@ module.exports = async function (content, sourceMap) {
})
}

content = install.call(this, 'installComponents', content, getMatches.call(this, 'Tag', tags, options.match, component), {registerStylesSSR: options.registerStylesSSR})
content = install.call(this, 'installComponents', content, getMatches.call(this, 'Tag', tags, options.match, component), options)
content = install.call(this, 'installDirectives', content, getMatches.call(this, 'Attr', attrs, options.attrsMatch, component))
}

Expand Down

0 comments on commit 6694f47

Please sign in to comment.