Added a dev run script
Signed-off-by: Alexander Mays <maysale01@gmail.com>
This commit is contained in:
26
bin/dev
Normal file
26
bin/dev
Normal 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);
|
||||
});
|
||||
@@ -33,10 +33,13 @@
|
||||
"babel-register": "^6.5.1",
|
||||
"codecov": "^1.0.1",
|
||||
"deep-diff": "^0.3.3",
|
||||
"gaze": "^0.5.2",
|
||||
"jasmine": "^2.3.2",
|
||||
"mongodb-runner": "^3.1.15"
|
||||
"mongodb-runner": "^3.1.15",
|
||||
"nodemon": "^1.8.1"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "npm run build && node bin/dev",
|
||||
"build": "./node_modules/.bin/babel src/ -d lib/",
|
||||
"pretest": "MONGODB_VERSION=${MONGODB_VERSION:=3.0.8} mongodb-runner start",
|
||||
"test": "NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node ./node_modules/.bin/babel-istanbul cover -x **/spec/** ./node_modules/.bin/jasmine",
|
||||
|
||||
Reference in New Issue
Block a user