Skip to content

Commit

Permalink
Merge pull request #12 from jonaskuske/panel-hmr
Browse files Browse the repository at this point in the history
feat: add support and docs for `kirbyup serve`
  • Loading branch information
lukasbestle committed Aug 22, 2022
2 parents 22cc8f3 + 153ffd5 commit b1caf46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@

# Composer files
/vendor

# kirbyup temp development entry
/index.dev.mjs
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ npm run dev
This will automatically update the `index.js` and `index.css` of your plugin as soon as you make changes.
Reload the Panel to see your code changes reflected.

With kirbyup 2.0.0+ and Kirby 3.7.4+ you can alternatively use hot module reloading (HMR):

```
npm run serve
```

This will start a development server that updates the page as soon as you make changes. Some updates are instant, like CSS or Vue template changes, others require a reload of the page, which happens automatically.

> 💡 The live reload functionality requires top level await, [which is only supported in modern browsers](https://caniuse.com/mdn-javascript_operators_await_top_level). If you're developing in older browsers, use `npm run dev` and reload the page manually to see changes.
### Production

As soon as you are happy with your plugin, you should build the final version with:
Expand Down

0 comments on commit b1caf46

Please sign in to comment.