Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions e2e/__projects__/style/components/Less.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<div>
<div :class="$style.a">a</div>
<div :class="styles.b">b</div>
<div :class="$style.c">c</div>
<div :class="styles.d">d</div>
</div>
</template>

Expand All @@ -19,6 +21,7 @@ export default defineComponent({
</script>

<style module lang="less">
@import './styles/less-a.less';
.a {
background-color: @primary-color;
}
Expand Down
7 changes: 7 additions & 0 deletions e2e/__projects__/style/components/styles/less-a.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import "variables";
.c {
color: @primary-color;
}
.d {
background-color: @primary-color;
}
2 changes: 1 addition & 1 deletion e2e/__projects__/style/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function mount(Component, props, slots) {
test('processes Less', () => {
mount(Less)
expect(document.getElementById('app').innerHTML).toEqual(
'<div><div class="a">a</div><div class="b">b</div></div>'
'<div><div class="a">a</div><div class="b">b</div><div class="c">c</div><div class="d">d</div></div>'
)
})

Expand Down
2 changes: 1 addition & 1 deletion lib/process-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function getPreprocessOptions(lang, filePath, jestConfig) {
})
}
}
if (lang === 'styl' || lang === 'stylus') {
if (lang === 'styl' || lang === 'stylus' || lang === 'less') {
return {
paths: [path.dirname(filePath), process.cwd()]
}
Expand Down