mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
only minimizing CSS files on non-development
This commit is contained in:
@@ -121,6 +121,7 @@ var path = require('path'),
|
|||||||
// Cache static files on production
|
// Cache static files on production
|
||||||
if (global.env !== 'development') {
|
if (global.env !== 'development') {
|
||||||
app.enable('cache');
|
app.enable('cache');
|
||||||
|
app.enable('minification');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Middlewares
|
// Middlewares
|
||||||
@@ -136,7 +137,7 @@ var path = require('path'),
|
|||||||
app.use(require('less-middleware')({
|
app.use(require('less-middleware')({
|
||||||
src: path.join(__dirname, '../', 'public'),
|
src: path.join(__dirname, '../', 'public'),
|
||||||
prefix: nconf.get('relative_path'),
|
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.bodyParser()); // Puts POST vars in request.body
|
||||||
app.use(express.cookieParser()); // If you want to parse cookies (res.cookies)
|
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),
|
src: path.join(__dirname, '../node_modules/' + themeId),
|
||||||
dest: path.join(__dirname, '../public/css'),
|
dest: path.join(__dirname, '../public/css'),
|
||||||
prefix: nconf.get('relative_path') + '/css',
|
prefix: nconf.get('relative_path') + '/css',
|
||||||
yuicompress: true
|
yuicompress: app.enabled('minification') ? true : false
|
||||||
}));
|
}));
|
||||||
|
|
||||||
next();
|
next();
|
||||||
@@ -220,7 +221,7 @@ var path = require('path'),
|
|||||||
src: path.join(__dirname, '../node_modules/nodebb-theme-vanilla'),
|
src: path.join(__dirname, '../node_modules/nodebb-theme-vanilla'),
|
||||||
dest: path.join(__dirname, '../public/css'),
|
dest: path.join(__dirname, '../public/css'),
|
||||||
prefix: nconf.get('relative_path') + '/css',
|
prefix: nconf.get('relative_path') + '/css',
|
||||||
yuicompress: true
|
yuicompress: app.enabled('minification') ? true : false
|
||||||
}));
|
}));
|
||||||
|
|
||||||
next();
|
next();
|
||||||
|
|||||||
Reference in New Issue
Block a user