only minimizing CSS files on non-development

This commit is contained in:
Julian Lam
2013-12-04 20:37:13 -05:00
parent 6bd4a34e69
commit 2125bb2223

View File

@@ -121,6 +121,7 @@ var path = require('path'),
// Cache static files on production
if (global.env !== 'development') {
app.enable('cache');
app.enable('minification');
}
// Middlewares
@@ -136,7 +137,7 @@ var path = require('path'),
app.use(require('less-middleware')({
src: path.join(__dirname, '../', 'public'),
prefix: nconf.get('relative_path'),
yuicompress: true
yuicompress: app.enabled('minification') ? true : false
}));
app.use(express.bodyParser()); // Puts POST vars in request.body
app.use(express.cookieParser()); // If you want to parse cookies (res.cookies)
@@ -206,7 +207,7 @@ var path = require('path'),
src: path.join(__dirname, '../node_modules/' + themeId),
dest: path.join(__dirname, '../public/css'),
prefix: nconf.get('relative_path') + '/css',
yuicompress: true
yuicompress: app.enabled('minification') ? true : false
}));
next();
@@ -220,7 +221,7 @@ var path = require('path'),
src: path.join(__dirname, '../node_modules/nodebb-theme-vanilla'),
dest: path.join(__dirname, '../public/css'),
prefix: nconf.get('relative_path') + '/css',
yuicompress: true
yuicompress: app.enabled('minification') ? true : false
}));
next();