minify flag not actually being used

v1.18.x
psychobunny 9 years ago
parent 3552e11817
commit f17fa3ca11

@ -62,7 +62,7 @@ var async = require('async'),
async.apply(plugins.reloadRoutes), async.apply(plugins.reloadRoutes),
function(next) { function(next) {
async.parallel([ async.parallel([
async.apply(Meta.js.minify, false), async.apply(Meta.js.minify),
async.apply(Meta.css.minify), async.apply(Meta.css.minify),
async.apply(Meta.sounds.init), async.apply(Meta.sounds.init),
async.apply(Meta.templates.compile), async.apply(Meta.templates.compile),

@ -123,7 +123,7 @@ module.exports = function(Meta) {
}); });
}; };
Meta.js.minify = function(minify, callback) { Meta.js.minify = function(callback) {
if (nconf.get('isPrimary') === 'true') { if (nconf.get('isPrimary') === 'true') {
/** /**
* Check if the parent process is running with the debug option --debug (or --debug-brk) * Check if the parent process is running with the debug option --debug (or --debug-brk)
@ -218,14 +218,14 @@ module.exports = function(Meta) {
}); });
}; };
Meta.js.getFromFile = function(minify, callback) { Meta.js.getFromFile = function(callback) {
var scriptPath = path.join(__dirname, '../../public/nodebb.min.js'), var scriptPath = path.join(__dirname, '../../public/nodebb.min.js'),
mapPath = path.join(__dirname, '../../public/nodebb.min.js.map'), mapPath = path.join(__dirname, '../../public/nodebb.min.js.map'),
paths = [scriptPath]; paths = [scriptPath];
file.exists(scriptPath, function(exists) { file.exists(scriptPath, function(exists) {
if (!exists) { if (!exists) {
winston.warn('[meta/js] No script file found on disk, re-minifying'); winston.warn('[meta/js] No script file found on disk, re-minifying');
Meta.js.minify(minify, callback); Meta.js.minify(callback);
return; return;
} }

@ -92,7 +92,7 @@ function initializeNodeBB(callback) {
function(next) { function(next) {
async.parallel([ async.parallel([
async.apply(meta.templates.compile), async.apply(meta.templates.compile),
async.apply(!skipJS ? meta.js.minify : meta.js.getFromFile, app.enabled('minification')), async.apply(!skipJS ? meta.js.minify : meta.js.getFromFile),
async.apply(!skipLess ? meta.css.minify : meta.css.getFromFile), async.apply(!skipLess ? meta.css.minify : meta.css.getFromFile),
async.apply(meta.sounds.init) async.apply(meta.sounds.init)
], next); ], next);

Loading…
Cancel
Save