Skip to content

Commit 77c821d

Browse files
cmath10lmiller1990
andauthored
fix: Less relative path in imports (#475)
Co-authored-by: Lachlan Miller <[email protected]>
1 parent a84eafb commit 77c821d

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

e2e/2.x/style/components/Less.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
<template>
2-
<div />
2+
<div>
3+
<div :class="$style.a">a</div>
4+
<div :class="$style.b">b</div>
5+
<div :class="$style.c">c</div>
6+
<div :class="$style.d">d</div>
7+
</div>
38
</template>
49

510
<style module lang="less">
11+
@import './styles/less-a.less';
612
.a {
713
background-color: @primary-color;
814
}
15+
.b {
16+
color: @primary-color;
17+
}
918
</style>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@import "variables";
2+
.c {
3+
color: @primary-color;
4+
}
5+
.d {
6+
background-color: @primary-color;
7+
}

packages/vue2-jest/lib/process-style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function getPreprocessOptions(lang, filePath, jestConfig) {
4545
})
4646
}
4747
}
48-
if (lang === 'styl' || lang === 'stylus') {
48+
if (lang === 'styl' || lang === 'stylus' || lang === 'less') {
4949
return {
5050
paths: [path.dirname(filePath), process.cwd()]
5151
}

0 commit comments

Comments
 (0)