Understand nodemon's option parsing precedence
mainWhen you run nodemon, it determines which file to execute and which configuration to apply by following a specific order of precedence. If multiple sources define the same option, the source higher in this list takes priority:
- CLI arguments: Any flags or arguments passed directly to the
nodemoncommand. - Local config: Configuration found in a local configuration file (e.g.,
nodemon.json). - Global config: Configuration found in your global nodemon configuration.
- package.json (
main): Themainfield in your project'spackage.json. - package.json (
start): Thestartfield in your project'spackage.json. - index.js: The default fallback to
index.jsin the current directory.