From 96b0a0253fa4661378d687d71bf7ffb2a082622f Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Mon, 17 Jun 2013 13:54:30 -0400 Subject: [PATCH] Use grunt.util.spawn for jsx:* tasks instead of exec. This should prevent "Warning: stdout maxBuffer exceeded" errors. Also piping child process stdout and stderr to the parent process, so you can see more of what's happening during the build process. --- grunt/tasks/jsx.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/grunt/tasks/jsx.js b/grunt/tasks/jsx.js index 08a84ab4f0..7aa8407596 100644 --- a/grunt/tasks/jsx.js +++ b/grunt/tasks/jsx.js @@ -1,14 +1,14 @@ 'use strict'; -var exec = require("child_process").exec; -var expand = require("grunt").file.expand; +var grunt = require("grunt"); +var expand = grunt.file.expand; +var spawn = grunt.util.spawn; module.exports = function() { var done = this.async(); var config = this.data; var args = [ - "bin/jsx", "--cache-dir", ".module-cache", "--relativize", config.sourceDir, @@ -25,5 +25,18 @@ module.exports = function() { args.push.apply(args, rootIDs); args.push("--config", config.configFile); - exec(args.join(" "), done); + var child = spawn({ + cmd: "bin/jsx", + args: args + }, function(error, result, code) { + if (error) { + grunt.log.error(error); + done(false); + } else { + done(); + } + }); + + child.stdout.pipe(process.stdout); + child.stderr.pipe(process.stderr); };