Skip to content

Commit 08a125e

Browse files
Only minify CSS when watch: false. (#442)
1 parent 18ba950 commit 08a125e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/graph-style.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ function node (state, createEdge) {
1717
var bundle
1818

1919
try {
20-
bundle = purify(script, style, { minify: true })
20+
bundle = purify(script, style)
2121
} catch (e) {
2222
this.emit('error', 'styles', 'purify-css', e)
2323
}
2424

25-
try {
26-
bundle = clean.minify(bundle).styles
27-
} catch (e) {
28-
this.emit('error', 'styles', 'clean-css', e)
25+
if (!state.metadata.watch) {
26+
try {
27+
bundle = clean.minify(bundle).styles
28+
} catch (e) {
29+
this.emit('error', 'styles', 'clean-css', e)
30+
}
2931
}
3032

3133
createEdge('bundle', Buffer.from(bundle), {

0 commit comments

Comments
 (0)