Last active
June 11, 2017 20:04
-
-
Save grishgrigoryan/de2fc973d96abbe4bac32f1c822b912f to your computer and use it in GitHub Desktop.
Typescript compile and browserify ( tsc -w & watchify )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var spawn = require('child_process').spawn; | |
var compile = spawn('./node_modules/.bin/tsc',['-w']); | |
compile.stdout.on('data', function (data) { | |
console.log('stdout: ' + data.toString()); | |
}); | |
compile.stderr.on('data', function (data) { | |
console.log('stderr: ' + data.toString()); | |
}); | |
compile.on('exit', function (code) { | |
console.log('child process exited with code ' + code.toString()); | |
}); | |
setTimeout(function () { | |
var browserify = spawn('./node_modules/.bin/watchify',['./out/index.js','-o','./public/js/bundle.js','-v']); | |
browserify.stdout.on('data', function (data) { | |
console.log('stdout: ' + data.toString()); | |
}); | |
browserify.stderr.on('data', function (data) { | |
console.log('stderr: ' + data.toString()); | |
}); | |
browserify.on('exit', function (code) { | |
console.log('child process exited with code ' + code.toString()); | |
}); | |
},2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment