Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# nextjs-hmr
#### Sample of how to enable hmr via Vagrant + Virtualbox or Docker in nextjs

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