This Trailpack will automatically reload your Trails application on code
changes. It listens for changes in
$ npm install --save trailpack-autoreload
// config/main.jsmoduleexports =packs:// ... other trailpacks
This trailpack offers significant performance advantages over other solutions
such as nodemon, which restarts the entire node process. This trailpack detects
the file(s) in which the change occured, evicts those modules from the
require cache, and reloads the Trails application (via
the application will continue running in its current state if a syntax error
is written into a watched file; Trails will inform you of the error, and carry on.
The synchronous node
require statement incurs non-negligible boot-time
overhead. We avoid these costs by evicting only the affected module(s).