From 66a7d9cef79f04d319a164d33a3cbbca3672eba0 Mon Sep 17 00:00:00 2001 From: Chris H Date: Wed, 19 Nov 2014 18:58:57 -0500 Subject: [PATCH] Move express-minify to optionalDependencies --- app.js | 9 ++++----- package.json | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 5b60145603..5405c444be 100755 --- a/app.js +++ b/app.js @@ -14,7 +14,6 @@ var compression = require('compression'); var cookieParser = require('cookie-parser'); var favicon = require('serve-favicon'); -var minify = require('express-minify'); var session = require('express-session'); var MongoStore = require('connect-mongo')(session); var mongoose = require('mongoose'); @@ -92,11 +91,11 @@ app.set('view engine', 'html'); app.set('views', __dirname + '/views'); -// Setup minification -// Order is important here as Ace will fail with an invalid content encoding issue -if (isPro || isDev) { +// Setup minification (optionalDependency) +try { + var minify = require('express-minify'); app.use(minify()); -} +} catch (e) {} // Routes require('./routes')(app); diff --git a/package.json b/package.json index 6c60dae9ce..093570a042 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "connect-mongo": "0.4.1", "cookie-parser": "1.3.3", "express": "4.10.2", - "express-minify": "0.0.11", "express-session": "1.9.1", "font-awesome": "4.2.0", "formidable": "1.0.15", @@ -53,6 +52,9 @@ "serve-favicon": "2.1.6", "underscore": "1.7.0" }, + "optionalDependencies": { + "express-minify": "0.0.11" + }, "repository": { "type": "git", "url": "https://github.com/OpenUserJs/OpenUserJS.org.git"