Skip to main content

Automatic Reload (Updated)

Automatic Reload

To enable automatic reloading, perform the following steps:

  1. Add the following lines to app.js :

    Pear.updates(() => Pear.reload())
  2. Run the app again using:

    pear run --dev .

    Now Pear observes project files, and after they change, the app is automatically reloaded.

  3. While keeping the pear run --dev . command running, open index.html in an editor.

  4. Change <h1>desktop</h1> to <h1>Hello world</h1>.

The app should now show:

Automatic reload

Live reload with hot-module reloading is possible by using the pear.watch configuration and the pear.updates API. The pear-hotmods convenience module can also be used.