From 444c07fa156aac974aea59308b1bf7eb36410cd3 Mon Sep 17 00:00:00 2001 From: Martii Date: Thu, 25 Nov 2021 03:01:00 -0700 Subject: [PATCH] Enhance *express-minify* implementation * Docs say exactly "Pass false to disable minifying (JS, CSS and JSON)" which is incorrect. See archived mirror at https://github.com/OpenUserJS/express-minify/blob/f0696f6d3976b6ac7c138d767bb62ae3835ddb38/index.js#L76 . Only does JS and CSS but not JSON. * Affects admin processes and any meta.json . We already minimize with conditionals of pro vs dev and shouldn't be needed. Applies to #432 --- app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 1e1cc5000..09b62dacd 100755 --- a/app.js +++ b/app.js @@ -482,7 +482,8 @@ app.use(function(aReq, aRes, aNext) { /^\/mod\/removed\//.test(pathname) ) { aRes.minifyOptions = aRes.minifyOptions || {}; // Ensure object exists on response - aRes.minifyOptions.minify = false; // Skip using release minification because we control this with *terser* + aRes.minifyOptions.minify = false; // Skip minification because we use *terser* with .js + aRes.minifyOptions.enabled = false; // Force no processing on remainder of types on these routes } aNext(); });