11#!/usr/bin/env node
22
3- const dev = require ( '.' )
3+ import { runDev } from '.'
44import minimist from 'minimist'
55
66const nodeArgs : string [ ] = [ ]
@@ -71,6 +71,7 @@ const devFlags = {
7171 'deps' ,
7272 'all-deps' ,
7373 'dedupe' ,
74+ 'fork' ,
7475 'exec-check' ,
7576 'debug' ,
7677 'poll' ,
@@ -96,24 +97,25 @@ const devFlags = {
9697
9798type DevOptions = {
9899 poll : boolean
99- debug : boolean ,
100+ debug : boolean
101+ fork : boolean
100102 watch : string
101103 interval : string
102104 rs : boolean
103- deps : boolean ,
104- dedupe : boolean ,
105- respawn : boolean ,
106- notify : boolean ,
107- clear : boolean ,
108- cls : boolean ,
109- 'ignore-watch' : string ,
110- 'all-deps' : boolean ,
105+ deps : boolean
106+ dedupe : boolean
107+ respawn : boolean
108+ notify : boolean
109+ clear : boolean
110+ cls : boolean
111+ 'ignore-watch' : string
112+ 'all-deps' : boolean
111113 [ 'deps-level' ] : string
112114 'compile-timeout' : string
113115 'exec-check' : boolean
114116 'exit-child' : boolean
115117 'cache-directory' : string
116- 'error-recompile' : boolean ,
118+ 'error-recompile' : boolean
117119 'tree-kill' : boolean
118120}
119121
@@ -130,8 +132,10 @@ const opts = minimist(devArgs, {
130132 alias : {
131133 ...tsNodeAlias ,
132134 'prefer-ts-exts' : 'prefer-ts' ,
135+ } ,
136+ default : {
137+ fork : true
133138 } ,
134- default : { } ,
135139 unknown : function ( arg ) {
136140 unknown . push ( arg )
137141 return true
@@ -163,8 +167,11 @@ unknown.forEach(function (arg) {
163167} )
164168
165169if ( ! script ) {
170+ // eslint-disable-next-line no-console
171+ console . log ( 'ts-node-dev: no script to run provided' )
172+ // eslint-disable-next-line no-console
166173 console . log ( 'Usage: ts-node-dev [options] script [arguments]\n' )
167174 process . exit ( 1 )
168175}
169176
170- dev ( script , scriptArgs , nodeArgs , opts )
177+ runDev ( script , scriptArgs , nodeArgs , opts )
0 commit comments