UNPKG

394 Btext/coffeescriptView Raw
1cleanCSS = require 'clean-css'
2sysPath = require 'path'
3
4module.exports = class CleanCSSMinifier
5 brunchPlugin: yes
6 type: 'stylesheet'
7
8 constructor: (@config) ->
9 null
10
11 minify: (data, path, callback) ->
12 try
13 minified = cleanCSS.process data
14 catch err
15 error = "CSS minify failed on #{path}: #{error}"
16 process.nextTick ->
17 callback error, (minified or data)