Closed WoodySlum closed 6 years ago
For an unknown reason it's working tonight. Just inverted stuff :
const minify = require("express-minify");
const uglifyEs = require("uglify-es");
if (this.enableCompression) {
this.app.use(compression({filter: (req, res) => {
if (req.headers["x-no-compression"]) {
// don't compress responses with this request header
return false;
}
// fallback to standard filter function
return compression.filter(req, res);
}}));
}
// Minify
this.app.use(minify({
cache: false,
uglifyJsModule: uglifyEs,
errorHandler: (errorInfo, callback) => {
Logger.err(errorInfo);
},
jsMatch: /javascript/,
cssMatch: /css/,
jsonMatch: false
}))
this.app.use(BodyParser.json({limit: "2mb"}));
this.app.use(BodyParser.urlencoded({ extended: false }));
this.app.use(ENDPOINT_UI, express.static(__dirname + "/../../../ui"));
Hi,
As the title explained, CSS are well minified, but the JS files are not :(
My js files are set under
ui/js/
and in the browser I can see that http://localhost:8100/js/bootstrap.js sent the good mime typeAny clue ?