Skip to content

Commit

Permalink
Enhance *express-minify* implementation (#1858)
Browse files Browse the repository at this point in the history
* 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

Auto-merge
  • Loading branch information
Martii committed Nov 25, 2021
1 parent d5313db commit b89d784
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app.js
Expand Up @@ -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();
});
Expand Down

0 comments on commit b89d784

Please sign in to comment.