Skip to content

Testing Hot Module Replacement with Parcel while the HTML is served by another server (python in this case)

License

Notifications You must be signed in to change notification settings

patoroco/parcel-hmr-with-python-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parcel HMR Example

This is a small example about how to get Hot Module Replacement (HMR) working with Parcel while we're serving the index with another server (python3 http.server).

The purpose is to be able to use Parcel while we're developing with a web framework like Django or Flask, avoiding to lose the HMR feature.

Install & Run

npm install

# run the python webserver in a terminal
npm run web

# run the watch in another terminal to watch the changes in the `index.html` and `index.js` files
npm run watch

After that, you'll be able to open http://localhost:8000/ in a browser, and once you add some changes in the index.html or index.js, the hot reloading should work.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Testing Hot Module Replacement with Parcel while the HTML is served by another server (python in this case)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published