jakubburkiewicz / uncss-brunch

[unmantained] UnCSS support for Brunch
MIT License
11 stars 1 forks source link

Add ability to use dynamic files callback #2

Closed Craga89 closed 8 years ago

Craga89 commented 8 years ago

In order to implement async logic for getting the files option, I've added the ability to specify this.files as a callback which takes the node-like signature:

files: function(path: String, cb: Function)

Which can be used like so:

files: function(path, cb) {
    var files;
    // ...some async logic to set files
    cb(null, files);
}

This lets you do dynamically generate the files passed to uncss, for example to get a list of webpages from the remote web server i.e. this blog post