File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env node
2
+
3
+ var nodemon = require ( 'nodemon' ) ;
4
+ var babel = require ( "babel-core" ) ;
5
+ var gaze = require ( 'gaze' ) ;
6
+ var fs = require ( 'fs' ) ;
7
+
8
+ // Watch the src and transpile when changed
9
+ gaze ( 'src/**/*' , function ( err , watcher ) {
10
+ if ( err ) throw err ;
11
+ watcher . on ( 'changed' , function ( file ) {
12
+ console . log ( file + " has changed" ) ;
13
+ fs . writeFile ( file . replace ( / \/ s r c \/ / , "/lib/" ) , babel . transformFileSync ( file ) . code ) ;
14
+ } ) ;
15
+ } ) ;
16
+
17
+ // Run and watch dist
18
+ nodemon ( {
19
+ script : 'bin/parse-server' ,
20
+ ext : 'js json' ,
21
+ watch : 'lib'
22
+ } ) ;
23
+
24
+ process . once ( 'SIGINT' , function ( ) {
25
+ process . exit ( 0 ) ;
26
+ } ) ;
Original file line number Diff line number Diff line change 33
33
"babel-register" : " ^6.5.1" ,
34
34
"codecov" : " ^1.0.1" ,
35
35
"deep-diff" : " ^0.3.3" ,
36
+ "gaze" : " ^0.5.2" ,
36
37
"jasmine" : " ^2.3.2" ,
37
- "mongodb-runner" : " ^3.1.15"
38
+ "mongodb-runner" : " ^3.1.15" ,
39
+ "nodemon" : " ^1.8.1"
38
40
},
39
41
"scripts" : {
42
+ "dev" : " npm run build && node bin/dev" ,
40
43
"build" : " ./node_modules/.bin/babel src/ -d lib/" ,
41
44
"pretest" : " MONGODB_VERSION=${MONGODB_VERSION:=3.0.8} mongodb-runner start" ,
42
45
"test" : " NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node ./node_modules/.bin/babel-istanbul cover -x **/spec/** ./node_modules/.bin/jasmine" ,
You can’t perform that action at this time.
0 commit comments