diff --git a/README.md b/README.md index 5b8fa7e..54d9917 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,10 @@ If you have an issue, please create one. But, before: - try to run it with `--debug` flag and see the output - try to make create repro example +## Building + +Run `tsc --build tsconfig.build.json` to transpile this project. + ## Versioning Currently versioning is not stable and it is still treated as pre-release. You might expect some options API changes. If you want to avoid unexpected problems it is recommended to fixate the installed version and update only in case of issues, you may consult [CHANGELOG](CHANGELOG.md) for updates. diff --git a/src/compiler.ts b/src/compiler.ts index 378c837..b7a73fa 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -234,8 +234,6 @@ export const makeCompiler = ( } }, compile: function (params: CompileParams) { - const fileName = params.compile - const code = fs.readFileSync(fileName, 'utf-8') const compiledPath = params.compiledPath // Prevent occasional duplicate compilation requests @@ -255,7 +253,10 @@ export const makeCompiler = ( if (fs.existsSync(compiledPath)) { return } + const starTime = new Date().getTime() + + const fileName = params.compile const m: any = { _compile: writeCompiled, } diff --git a/src/index.ts b/src/index.ts index ed1be9c..e928a11 100644 --- a/src/index.ts +++ b/src/index.ts @@ -220,9 +220,10 @@ export const runDev = ( child.stopping = true child.respawn = true if (child.connected === undefined || child.connected === true) { - log.debug('Disconnecting from child') - child.disconnect() - if (!willTerminate) { + if (willTerminate) { + log.debug('Disconnecting from child') + child.disconnect() + } else { killChild() } }