Skip to content

Moving HMR out of experimental phase

Compare
Choose a tag to compare
@thetutlage thetutlage released this 22 Apr 07:00

The support for HMR is now stable and you can start using it. For existing projects, you must upgrade the @adonisjs/core and the @adonisjs/assembler packages to their latest releases before 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@latest

Next 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 --hmr

If you use npm scripts, then make sure to update the dev script as well in the package.json file.

{
  "scripts": {
    "dev": "node ace serve --hmr"
  }
}

Commits

  • chore: update dependencies (c370640)
  • refactor: move from --unstable-hmr to --hmr (40a85f9)

Full Changelog: v6.7.1...v6.8.0