Skip to content

Instantly share code, notes, and snippets.

@grishgrigoryan
Last active June 11, 2017 20:04
Show Gist options
  • Save grishgrigoryan/de2fc973d96abbe4bac32f1c822b912f to your computer and use it in GitHub Desktop.
Save grishgrigoryan/de2fc973d96abbe4bac32f1c822b912f to your computer and use it in GitHub Desktop.
Typescript compile and browserify ( tsc -w & watchify )
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