Skip to content

Instantly share code, notes, and snippets.

@pongo
Created July 15, 2019 14:25
Show Gist options
  • Select an option

  • Save pongo/7c643586f4defd0695b9992aebcb4ec8 to your computer and use it in GitHub Desktop.

Select an option

Save pongo/7c643586f4defd0695b9992aebcb4ec8 to your computer and use it in GitHub Desktop.
Liveload (hotreload) css for parcel with live-server

If you want to reload after file changes, you can run Parcel in watch mode, which compiles changes to another directory (default ./dist/) but does not run a server.

parcel watch index.html --no-hmr

Then run a live-server, which listens to file changes and reloads (assuming your output is to the ./dist/ directory)

live-server ./dist/

Here's what my npm start script looks like:

parcel watch ./src/index.html --no-hmr & live-server --port=8000 ./dist/

source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment