Skip to content

Commit 51fe4ef

Browse files
authored
Merge pull request #287 from FRSource/fix-external-css-properly-handle-HTML5-syntax
fix: external css properly handle html5-compliant syntax
2 parents d92f21f + 909e172 commit 51fe4ef

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

e2e/__projects__/style/components/External.vue

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
<style module="$style2" src="~__styles/external.css" />
1010

11+
<style module="$style3" src="./styles/external.css"></style>
12+
1113
<style module="css">
1214
.a {
1315
background: color(red a(90%));

e2e/__projects__/style/test.js

+1
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ test('process External', () => {
4646
expect(wrapper.vm).toBeTruthy()
4747
expect(wrapper.vm.$style.testClass).toEqual('testClass')
4848
expect(wrapper.vm.$style2.testClass).toEqual('testClass')
49+
expect(wrapper.vm.$style3.testClass).toEqual('testClass')
4950
expect(wrapper.vm.css.a).toEqual('a')
5051
})

lib/process-style.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function getPreprocessOptions(lang, filePath, jestConfig) {
5252
module.exports = function processStyle(stylePart, filePath, config = {}) {
5353
const vueJestConfig = getVueJestConfig(config)
5454

55-
if (stylePart.src && !stylePart.content) {
55+
if (stylePart.src && !stylePart.content.trim()) {
5656
const cssFilePath = applyModuleNameMapper(
5757
stylePart.src,
5858
filePath,

0 commit comments

Comments
 (0)