When build script fails, node.js doesn't flush stdout and stderr streams. Because r.js uses console.log() (which writes to stdout) user doesn't see error message and it's hard to understand what happened.
Solution can be in using blocking output instead of console.log(). In this way:
define('node/print', ['fs'], function (fs) {
function print(msg) {
fs.writeSync(process.stdout.fd, msg + '\n');
fs.fsyncSync(process.stdout.fd);
}
return print;
});
When build script fails, node.js doesn't flush stdout and stderr streams. Because r.js uses console.log() (which writes to stdout) user doesn't see error message and it's hard to understand what happened.
Solution can be in using blocking output instead of console.log(). In this way: