Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore broken *express-minify* ability to minify everything #434

Merged
merged 1 commit into from
Nov 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ var compression = require('compression');
var cookieParser = require('cookie-parser');
var favicon = require('serve-favicon');

var minify = null;
try {
minify = require('express-minify');
} catch (e) {}

var session = require('express-session');
var MongoStore = require('connect-mongo')(session);
var mongoose = require('mongoose');
Expand Down Expand Up @@ -93,12 +98,8 @@ app.set('views', __dirname + '/views');

// Setup minification
// Order is important here as Ace will fail with an invalid content encoding issue
if (isPro) {
app.use(require('express-minify')());
} else if (isDev) {
try {
app.use(require('express-minify')());
} catch (e) {}
if (minify && isPro || isDev) {
app.use(minify());
}

// Routes
Expand Down