Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thundermiracle/nextjs-hmr
Example of enable hmr via vagrant-virtualbox or docker in nextjs
https://github.com/thundermiracle/nextjs-hmr
docker hmr nextjs nextjs-hmr sample-code vagrant virtualbox windows
Last synced: 5 days ago
JSON representation
Example of enable hmr via vagrant-virtualbox or docker in nextjs
- Host: GitHub
- URL: https://github.com/thundermiracle/nextjs-hmr
- Owner: thundermiracle
- License: mit
- Created: 2018-01-11T02:33:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-28T12:08:13.000Z (almost 5 years ago)
- Last Synced: 2024-10-03T12:19:28.252Z (4 months ago)
- Topics: docker, hmr, nextjs, nextjs-hmr, sample-code, vagrant, virtualbox, windows
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nextjs-hmr
#### Sample of how to enable hmr via Vagrant + Virtualbox or Docker in nextjshmr(HotModuleReplacement) is one of the MUST HAVE functions in web development. But as VirtualBox DOESN'T (and will not) provide a mechanism to watch on file changes. It's only possible to poll for changes.
This project is a sample of how to poll for changes with webpack options in nextjs.
#### Following environments have been tested with Windows10 + Vagrant1.9.5 + VirtualBox5.1.22:
- CentOS7
- Ubuntu14#### Following Docker image has been tested as well
- node:boron-alpine
```
docker-compose up -d
```#### Test
Try change the backgroud color in [index.js](/src/pages/index.js)
#### Referencens:
- https://webpack.js.org/configuration/watch/#watchoptions