gimm / gulp-express

gulp plugin for express
56 stars 26 forks source link

Into the options to run you could add some debug flags. #8

Closed thiagomata closed 10 years ago

thiagomata commented 10 years ago

To run my server into the debug mode, using the node-inspector, I need to use the --debug command:

node --debug ./dist/server/server.js 

Into the gulpfile.js my call to run the server is something like

  server.run({
    file: "./dist/server/server.js"
  })

In the current version, I am unable to send to the server.run the debug option. I was hopping find something like:

 server.run({
    file: fileServer,
    args: ['--debug']
 })

I found how to do it, I replace the lines into the index.js:

        service = child_process.spawn('node', [options.file], {
            NODE_ENV: options.env
        });

By this ones:

        if( options.args == undefined ) {
            service = child_process.spawn('node', [options.file], {
                NODE_ENV: options.env
            });
        } else {
            var args = options.args;
            args.push( options.file );
            service = child_process.spawn('node', args, {
                NODE_ENV: options.env
            });                
        }

I am creating a clone and applying into. But, it is as simple as look.

gimm commented 10 years ago

Changes were merged.