From 43fdfaeb83b6abdfac6ccacb6785f1e2d0a1674b Mon Sep 17 00:00:00 2001 From: yuuangzhang Date: Sun, 22 Aug 2021 23:52:26 +0800 Subject: [PATCH] fix: css module injectStyles bug in ssr close #1866 --- lib/codegen/styleInjection.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/codegen/styleInjection.js b/lib/codegen/styleInjection.js index 9a8cfc99a..ea5b161ab 100644 --- a/lib/codegen/styleInjection.js +++ b/lib/codegen/styleInjection.js @@ -91,6 +91,7 @@ module.exports = function genStyleInjectionCode ( const request = genStyleRequest(style, i) styleInjectionCode += ( `var style${i} = require(${request})\n` + + `style${i} = style${i}.default || style${i}\n` + `if (style${i}.__inject__) style${i}.__inject__(context)\n` ) if (style.module) genCSSModulesCode(style, request, i)