Skip to content

Commit

Permalink
Merge branch 'main' of github.com:remy/nodemon
Browse files Browse the repository at this point in the history
* 'main' of github.com:remy/nodemon:
  fix: remove ts mapping if loader present
  One more fix
  Get rid of spawning shell windows if nodemon is started without console.
  • Loading branch information
remy committed Mar 11, 2023
2 parents 204af11 + 1468397 commit b11ddd1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
14 changes: 9 additions & 5 deletions 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: {
Expand All @@ -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,
Expand All @@ -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;
9 changes: 7 additions & 2 deletions lib/monitor/run.js
Expand Up @@ -90,6 +90,7 @@ function run(options) {
sh = process.env.comspec || 'cmd';
shFlag = '/d /s /c';
spawnOptions.windowsVerbatimArguments = true;
spawnOptions.windowsHide = true;
}

var args = runCmd ? utils.stringify(executable, cmd.args) : ':';
Expand Down Expand Up @@ -122,11 +123,15 @@ function run(options) {
var forkArgs = cmd.args.slice(1);
var env = utils.merge(options.execOptions.env, process.env);
stdio.push('ipc');
child = fork(options.execOptions.script, forkArgs, {
const forkOptions = {
env: env,
stdio: stdio,
silent: !hasStdio,
});
};
if (utils.isWindows) {
forkOptions.windowsHide = true;
}
child = fork(options.execOptions.script, forkArgs, forkOptions);
utils.log.detail('forking');
debug('fork', sh, shFlag, args);
} else {
Expand Down
1 change: 1 addition & 0 deletions lib/spawn.js
Expand Up @@ -44,6 +44,7 @@ module.exports = function spawnCommand(command, config, eventArgs) {
sh = process.env.comspec || 'cmd';
shFlag = '/d /s /c';
spawnOptions.windowsVerbatimArguments = true;
spawnOptions.windowsHide = true;
}

const args = command.join(' ');
Expand Down

0 comments on commit b11ddd1

Please sign in to comment.