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

Keep comments? #15

Closed Martii closed 9 years ago

Martii commented 9 years ago

Over at our project we could really use the keep comments option in this package from uglify-js but still minify everything else (in select JavaScript code)... any chance of that here?

TIA.

breezewish commented 9 years ago

You can now pass UglifyJs options, for example keeping comment:

app.use(function(req, res, next)
{
    if (/\.(user|meta)\.js$/.test(req.url)) {
        res._uglifyOutput = {
            comments: true
        };
    }
    next();
});
Martii commented 9 years ago

Awesome!! I look forward to testing this... thank you. :)


btw great work with this... it's very easy to configure and use.

Martii commented 9 years ago

Working well here but a few issues with uglify-js and node release version. I'll see if I can perhaps address at least some of those across the pond.... closing... Thank you again.