From 5a0ef354f1fcaf3ea3c7658fdb6ba60bf1a7b0e2 Mon Sep 17 00:00:00 2001 From: Cameron Diver Date: Fri, 7 Jun 2019 14:58:28 +0100 Subject: [PATCH] Fix ts-node invocation in balena-dev Properly pull in the project file, as it exists in a different directory. Change-type: patch Signed-off-by: Cameron Diver --- bin/balena-dev | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/balena-dev b/bin/balena-dev index 2b0dfdb43..a43a63e9c 100755 --- a/bin/balena-dev +++ b/bin/balena-dev @@ -11,13 +11,19 @@ process.env.UV_THREADPOOL_SIZE = '64'; // Use fast-boot to cache require lookups, speeding up startup require('fast-boot2').start({ - cacheFile: '.fast-boot.json' + cacheFile: '.fast-boot.json', }); require('coffeescript/register'); + +const path = require('path'); +const rootDir = path.join(__dirname, '..'); // Note: before ts-node v6.0.0, 'transpile-only' (no type checking) was the // default option. We upgraded ts-node and found that adding 'transpile-only' // was necessary to avoid a mysterious 'null' error message. On the plus side, // it is supposed to run faster. We still benefit from type checking when // running 'npm run build'. -require('ts-node/register/transpile-only'); +require('ts-node').register({ + project: path.join(rootDir, 'tsconfig.json'), + transpileOnly: true, +}); require('../lib/app').run();