Skip to content

pokeghosst/parcel-transformer-prefresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parcel-transformer-prefresh

license version downloads

Transformer enabling prefresh Hot Module Reloading (HMR) in Preact apps using Parcel

Installing

npm install --save-dev parcel-transformer-prefresh @parcel/config-default @prefresh/core @prefresh/utils

Usage

Add to .parcelrc:

{
  "extends": "@parcel/config-default",
  "transformers": {
    "*.{js,jsx,ts,tsx}": ["parcel-transformer-prefresh", "..."]
  }
}

Add to your main entry file (e.g., src/main.jsx):

import { render } from "preact";
import { App } from "./App";

if (process.env.NODE_ENV !== "production" && module.hot) {
  require("@prefresh/core");
}

render(<App />, document.getElementById("app"));

Serve your app:

parcel serve src/index.html

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

For bugs and feature requests, don't hesitate to open issues!

License

The project is released under the MIT License.

About

Transformer enabling prefresh Hot Module Reloading (HMR) in Preact apps using Parcel

Resources

License

Stars

Watchers

Forks