breezewish / express-minify

Automatically minify and cache your javascript and css files.
https://npmjs.org/package/express-minify
MIT License
86 stars 18 forks source link

What's the reason why to remove blacklist support? #35

Closed PeterDaveHello closed 9 years ago

PeterDaveHello commented 9 years ago

Hi @SummerWish,

I think it's really useful, don't know if there is special reason to remove it?

Cause I found that if the json file be two large, the works will be locked, I need to ignore them ...

Thanks ...

breezewish commented 9 years ago

Hi,

it is replaced by a more flexable feature: res._skip.

for example:

app.use(function(req, res, next)
{
    if (req.url.indexOf('my-last-file.js')) {   // you can write more complex logic here
        res._skip = true;
    }
    next();
});
app.use(minify());
PeterDaveHello commented 9 years ago

oh ... okay ... maybe we don't need a complex and flexable for all time xD

breezewish commented 9 years ago

LOL make full use of the middleware concept :-) you can write much more complex logic here, blacklists are no longer limited to an regular expression.