Currently it is possible (for e.g. a command to build js assets outside of app startup) for a module to act as a run-and-exit command with the following coordination:
- A config flag to run whatever process and then stop & exit:
if (this.config.commandName) this.runCommandAfterLaunch.then(::app.stop).then(::process.exit)
- Disable the router module and application file watcher (there's a potentially larger set you might want to disable, but hard to reason about whether any might be contributing to the application behavior you want to command)
- Combine all these flags into an npm script in the application file, e.g.
DEBUG=nxus:module:* nxus_router__disabled=true nxus_module__command=true npm start
Ideally these patterns could be supported more directly.
Currently it is possible (for e.g. a command to build js assets outside of app startup) for a module to act as a run-and-exit command with the following coordination:
if (this.config.commandName) this.runCommandAfterLaunch.then(::app.stop).then(::process.exit)DEBUG=nxus:module:* nxus_router__disabled=true nxus_module__command=true npm startIdeally these patterns could be supported more directly.