Added a dev run script

Signed-off-by: Alexander Mays <maysale01@gmail.com>
This commit is contained in:
Alexander Mays
2016-02-09 06:36:36 -05:00
parent 244febf4a9
commit 18f9e53405
2 changed files with 30 additions and 1 deletions

26
bin/dev Normal file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env node
var nodemon = require('nodemon');
var babel = require("babel-core");
var gaze = require('gaze');
var fs = require('fs');
// Watch the src and transpile when changed
gaze('src/**/*', function(err, watcher) {
if (err) throw err;
watcher.on('changed', function(file) {
console.log(file + " has changed");
fs.writeFile(file.replace(/\/src\//, "/lib/"), babel.transformFileSync(file).code);
});
});
// Run and watch dist
nodemon({
script: 'bin/parse-server',
ext: 'js json',
watch: 'lib'
});
process.once('SIGINT', function() {
process.exit(0);
});