Skip to content

Commit

Permalink
Only minify CSS when watch: false. (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop authored Mar 22, 2018
1 parent 18ba950 commit 08a125e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/graph-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ function node (state, createEdge) {
var bundle

try {
bundle = purify(script, style, { minify: true })
bundle = purify(script, style)
} catch (e) {
this.emit('error', 'styles', 'purify-css', e)
}

try {
bundle = clean.minify(bundle).styles
} catch (e) {
this.emit('error', 'styles', 'clean-css', e)
if (!state.metadata.watch) {
try {
bundle = clean.minify(bundle).styles
} catch (e) {
this.emit('error', 'styles', 'clean-css', e)
}
}

createEdge('bundle', Buffer.from(bundle), {
Expand Down

0 comments on commit 08a125e

Please sign in to comment.