Skip to content

Commit b7d5322

Browse files
committed
add proccess on file change hook
1 parent 4de3d90 commit b7d5322

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "ts-node-dev",
3-
"version": "1.1.6",
2+
"name": "ts-node-dev-with-hook",
3+
"version": "1.1.7",
44
"description": "Compiles your TS app and restarts when files are modified.",
55
"keywords": [
66
"restart",
@@ -97,4 +97,4 @@
9797
"publishConfig": {
9898
"registry": "https://registry.npmjs.org"
9999
}
100-
}
100+
}

src/index.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export const runDev = (
4040
// The child_process
4141
let child:
4242
| (ChildProcess & {
43-
stopping?: boolean
44-
respawn?: boolean
45-
})
43+
stopping?: boolean
44+
respawn?: boolean
45+
})
4646
| undefined
4747

4848
const wrapper = resolveMain(__dirname + '/wrap.js')
@@ -92,12 +92,12 @@ export const runDev = (
9292

9393
log.info(
9494
'ts-node-dev ver. ' +
95-
version +
96-
' (using ts-node ver. ' +
97-
tsNodeVersion +
98-
', typescript ver. ' +
99-
tsVersion +
100-
')'
95+
version +
96+
' (using ts-node ver. ' +
97+
tsNodeVersion +
98+
', typescript ver. ' +
99+
tsVersion +
100+
')'
101101
)
102102

103103
/**
@@ -250,7 +250,8 @@ export const runDev = (
250250
const result = vm.runInNewContext(code, {
251251
require: require("esm")(module),
252252
module,
253-
console
253+
console,
254+
process
254255
});
255256
if (!result) {
256257
notify('FileChangeHook', 'Hook exit code: 0.')

0 commit comments

Comments
 (0)