mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +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 parent
fad7d58fc9
commit
96b0a0253f
1 file changed
+17
-4
+17
-4
@@ -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