mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user