Permalink
Browse files

fix: allow less which is empty or comments only (vuejs#151)

fixes vuejs#132
  • Loading branch information...
hmsk authored and znck committed Nov 23, 2017
1 parent 16e7a72 commit 9387215d6fe7bbaaf3a18ef43021ae81b42cf720
Showing with 24 additions and 3 deletions.
  1. +2 −2 src/style/less/index.js
  2. +3 −0 test/expects/empty-less.css
  3. +3 −0 test/expects/empty-less.js
  4. +14 −0 test/fixtures/empty-less.vue
  5. +2 −1 test/test.js
@@ -19,8 +19,8 @@ export default async function (style, options) {
)

style.$compiled = {
code: css.toString(),
map: map.toString()
code: css && css.toString() || '',
map: map && map.toString() || ''
}

return style
@@ -0,0 +1,3 @@
/*# sourceMappingURL=empty-less.vue.map */

/*# sourceMappingURL=empty-less.vue.map */
@@ -0,0 +1,3 @@
var emptyLess = { template: "<div class=\"goodbye\"></div>",};

export default emptyLess;
@@ -0,0 +1,14 @@
<template>
<div class="goodbye"></div>
</template>

<script>
export default {}
</script>

<style lang="less">
</style>

<style lang="less">
// Empty essentially
</style>
@@ -67,7 +67,8 @@ function test(name) {
'style',
'stylus',
'external-script',
'postcss'
'postcss',
'empty-less'
].indexOf(name) > -1) {
var css = read('expects/' + name + '.css')
assert.equal(css.trim(), actualCss.trim(), 'should output style tag content')

0 comments on commit 9387215

Please sign in to comment.