Alright, so we have finally landed support for HMR in experimental mode. Once you upgrade the @adonisjs/core and the @adonisjs/assembler packages to their latest releases, you can start using the HMR mode.
This is what you need to do.
npm i -D hot-hook @adonisjs/assembler@latest
npm i @adonisjs/core@latestNext update the package.json file with the following configuration
"hotHook": {
"boundaries": [
"./app/controllers/**/*.ts",
"./app/middlewares/*.ts"
]
}And start the HTTP server as follows.
node ace serve --unstable-hmrIf you use npm scripts, then make sure to update the dev script as well in the package.json file.
{
"scripts": {
"dev": "node ace serve --unstable-hmr"
}
}Commits
- Merge pull request #4504 from adonisjs/feat/hmr (e472091)
- refactor: remove unused symbols (fbdae40)
- chore: update dependencies (4a9d201)
- Merge branch 'develop' into feat/hmr (9b2aadc)
- refactor: move to
--unstable-hmrflag (cdc266a) - test: add test (6c2bff9)
- feat: add serve
--hmrflag (3e11c21)
What's Changed
- feat: add
--hmrflag for theservecommand by @Julien-R44 in #4504
Full Changelog: v6.6.0...v6.7.0