mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
Merge pull request #2895 from EvSpirit/master
#2893 increment --debug-brk port value when forking js-minifier child pr...
This commit is contained in:
@@ -111,7 +111,24 @@ module.exports = function(Meta) {
|
||||
|
||||
Meta.js.minify = function(minify, callback) {
|
||||
if (nconf.get('isPrimary') === 'true') {
|
||||
var minifier = Meta.js.minifierProc = fork('minifier.js'),
|
||||
/**
|
||||
* Check if the parent process is running with the debug option --debug (or --debug-brk)
|
||||
*/
|
||||
var forkProcessParams = {};
|
||||
if(global.v8debug) {
|
||||
/**
|
||||
* use the line below if you want to debug minifier.js script too (or even --debug-brk option, but
|
||||
* you'll have to setup your debugger and connect to the forked process)
|
||||
*/
|
||||
//forkProcessParams = {execArgv: ['--debug=' + (global.process.debugPort + 1), '--nolazy']};
|
||||
|
||||
/**
|
||||
* otherwise, just clean up --debug/--debug-brk options which are set up by default from the parent one
|
||||
*/
|
||||
forkProcessParams = {execArgv: []};
|
||||
}
|
||||
|
||||
var minifier = Meta.js.minifierProc = fork('minifier.js', [], forkProcessParams),
|
||||
onComplete = function(err) {
|
||||
if (err) {
|
||||
winston.error('[meta/js] Minification failed: ' + err.message);
|
||||
|
||||
Reference in New Issue
Block a user