JSPM

  • Created
  • Published
  • Downloads 35008
  • Score
    100M100P100Q149634F
  • License MIT

Package Exports

  • @prefresh/webpack
  • @prefresh/webpack/package.json

Readme

Prefresh-webpack

npm version

Setup

npm i -s @prefresh/webpack
## OR
yarn add @prefresh/webpack 

Then add it to your webpack config by doing

import PreactRefreshPlugin from '@prefresh/webpack';

const config = {
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new PreactRefreshPlugin(),
  ],
  devServer: {
    hot: true, // ensure dev-server.hot is on
    ...moreDevServerConfig
  },
  ...moreWebpackConfig
}

Using hooks

If you're using preact/hooks you'll need something extra to ensure we can handle changes in hooks well.

You'll need to add react-refresh/babel to your babel-configuration to make this work together.