From f7816e445b61e77dd57d5c9ccf5fa0be4f9b18a7 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Thu, 16 Feb 2023 13:40:55 +0000 Subject: [PATCH] fix: remove ts mapping if loader present fixes #2083 --- lib/config/defaults.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/config/defaults.js b/lib/config/defaults.js index e2a448b4..c1795b99 100644 --- a/lib/config/defaults.js +++ b/lib/config/defaults.js @@ -1,7 +1,7 @@ var ignoreRoot = require('ignore-by-default').directories(); // default options for config.options -module.exports = { +const defaults = { restartable: 'rs', colours: true, execMap: { @@ -12,7 +12,7 @@ module.exports = { // compatible with linux, mac and windows, or make the default.js // dynamically append the `.cmd` for node based utilities }, - ignoreRoot: ignoreRoot.map(_ => `**/${_}/**`), + ignoreRoot: ignoreRoot.map((_) => `**/${_}/**`), watch: ['*.*'], stdin: true, runOnChangeOnly: false, @@ -22,7 +22,11 @@ module.exports = { // but also includes stderr. If this is false, data is still dispatched via // nodemon.on('stdout/stderr') stdout: true, - watchOptions: { - - }, + watchOptions: {}, }; + +if ((process.env.NODE_OPTIONS || '').includes('--loader')) { + delete defaults.execMap.ts; +} + +module.exports = defaults;