Gulp: Allow overriding node flags (namely --stack_size)

Created on 16 Mar 2016  路  6Comments  路  Source: gulpjs/gulp

Hi,

I just stumbled upon an issue with gulp-uglify, which actually lies within uglify2 itself:

If a JS file contains too many consecutive statements, it requires a bigger stack size, and there鈥檚 no way to override that with gulp other than running node --stack_size=2048 $(which gulp) build.

Could this be added to gulp?

Most helpful comment

I encoutered the node-flag problem like below
gulp --page a

/usr/local/bin/node: bad option: --page
[17:35:06] Node flags detected: --page
[17:35:06] Respawned to PID: 11748

and i finnally found the solution: install gulp-cli globally
sudo npm install gulp-cli -g

All 6 comments

v8 flags are already supported by gulp, if gulp sees a flag that is a flag that v8 looks for, we do a "flagged respawn" of the process. Just add it to your command like gulp build --stack_size=2048

Oh, indeed. It does not seem to be parsing flags properly though.

$ gulp build --stack_size=2048
[18:57:22] Node flags detected:
Error: missing value for flag --stack_size of type int
Try --help for options
node: bad option: --stack_size
[18:57:22] Respawned to PID: 39573

Sounds like a bug in https://github.com/js-cli/js-flagged-respawn - can you open an issue over there? A failing test would also help a ton

Will do.

I encoutered the node-flag problem like below
gulp --page a

/usr/local/bin/node: bad option: --page
[17:35:06] Node flags detected: --page
[17:35:06] Respawned to PID: 11748

and i finnally found the solution: install gulp-cli globally
sudo npm install gulp-cli -g

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronroberson picture aaronroberson  路  4Comments

amio picture amio  路  3Comments

borodean picture borodean  路  5Comments

XaBerr picture XaBerr  路  3Comments

joe-watkins picture joe-watkins  路  5Comments