Skip to content

Commit

Permalink
Fix ts-node invocation in balena-dev
Browse files Browse the repository at this point in the history
Properly pull in the project file, as it exists in a different
directory.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
  • Loading branch information
Cameron Diver committed Jun 7, 2019
1 parent f8a9c10 commit 5a0ef35
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/balena-dev
Expand Up @@ -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();

0 comments on commit 5a0ef35

Please sign in to comment.