Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 934905c

Browse files
committed
🎨 Remove log from style generated source
1 parent 087d5f8 commit 934905c

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
dist/
2+
test/style.css
23
# Logs
34
logs/
45
*.log
@@ -36,4 +37,4 @@ node_modules
3637
.node_repl_history
3738

3839
.idea
39-
.DS_Store
40+
.DS_Store

src/style.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ export default function (files, options) {
3737
// Emit styles to file
3838
writeFile(dest, css, (err) => {
3939
if (err) throw err
40-
console.log(dest, css.length)
4140
})
4241
};

test/test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ function test(name) {
1717
var entry = './fixtures/' + name + '.vue'
1818
var expected = read('expects/' + name + '.js').replace(/\r/g, '')
1919
var actualCss
20+
var cssHandler = function (css) {
21+
actualCss = css
22+
}
23+
2024
return rollup.rollup({
2125
format: 'cjs',
2226
entry: entry,
2327
plugins: [vuePlugin({
24-
css (css) {
25-
actualCss = css
26-
},
28+
css: cssHandler,
2729
compileTemplate: ['compileTemplate', 'slot', 'table'].indexOf(name) > -1
2830
})]
2931
}).then(function (bundle) {
@@ -33,10 +35,10 @@ function test(name) {
3335

3436
// Check css output
3537
if (name === 'style') {
36-
var css = read('expects/' + name + '.css').replace(/\r/g, '')
37-
assert.equal(actualCss, css, 'should output style tag content')
38+
var css = read('expects/' + name + '.css')
39+
assert.equal(css, actualCss, 'should output style tag content')
3840
} else {
39-
assert.equal(actualCss, '', 'should always call css()')
41+
assert.equal('', actualCss, 'should always call css()')
4042
}
4143
}).catch(function (error) {
4244
throw error

0 commit comments

Comments
 (0)