From 2bef8c1e38bd0018fe867b72b3c3c32aba0fff23 Mon Sep 17 00:00:00 2001 From: Benoit Lemaire Date: Sat, 29 Feb 2020 11:13:30 -0800 Subject: [PATCH] :bug: Fix ern dev version issue --- ern-local-cli/src/index.dev.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ern-local-cli/src/index.dev.js b/ern-local-cli/src/index.dev.js index affbb0714..bb005a45d 100644 --- a/ern-local-cli/src/index.dev.js +++ b/ern-local-cli/src/index.dev.js @@ -3,13 +3,10 @@ const path = require('path') const Module = require('module') const oload = Module._load +const workspacePath = path.resolve(__dirname, '../..') + process.env.ERN_ENV = 'development' -process.env.TS_NODE_PROJECT = path.resolve( - __dirname, - '..', - '..', - 'tsconfig.json' -) +process.env.TS_NODE_PROJECT = path.resolve(workspacePath, 'tsconfig.json') let tsNodeSourceMapSupportModule Module._load = function(file, parent) { @@ -23,6 +20,9 @@ Module._load = function(file, parent) { } } -require('tsconfig-paths/register') -require('ts-node').register({ transpileOnly: true }) +require(path.normalize(`${workspacePath}/node_modules/tsconfig-paths/register`)) +require(path.normalize(`${workspacePath}/node_modules/ts-node`)).register({ + dir: workspacePath, + transpileOnly: true, +}) require('./index.ts')