We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c13a34 commit c2e3e19Copy full SHA for c2e3e19
lib/codegen/styleInjection.js
@@ -1,5 +1,6 @@
1
const { attrsToQuery } = require('./utils')
2
const hotReloadAPIPath = JSON.stringify(require.resolve('vue-hot-reload-api'))
3
+const allWhitespaceRE = /^\s+$/
4
5
module.exports = function genStyleInjectionCode (
6
loaderContext,
@@ -69,6 +70,8 @@ module.exports = function genStyleInjectionCode (
69
70
}
71
72
73
+ // filter out empty styles (with no `src` specified or only contains whitespaces)
74
+ styles = styles.filter(style => style.src || !allWhitespaceRE.test(style.content))
75
// explicit injection is needed in SSR (for critical CSS collection)
76
// or in Shadow Mode (for injection into shadow root)
77
// In these modes, vue-style-loader exports objects with the __inject__
0 commit comments