@hippy/hippy-hmr-plugin

0.1.1 • Public • Published

Hippy HMR Plugin

support hmr of @hippy/vue, @hippy/react

@hippy/vue, @hippy/react version >= 2.2.2

How to use

This plugin should use together with hippy vue loader, hippy react refresh webpack plugin and hipp debug server, an example webpack config like this:

const HippyHMRPlugin = require('@hippy/hippy-hmr-plugin');
const VueLoaderPlugin = require('@hippy/vue-loader/lib/plugin');
const vueLoader = '@hippy/vue-loader';

module.exports = {
  devServer: {                    
    hot: true,
    devMiddleware: {
      writeToDisk: true,
    },
  },
  output: {
    filename: 'index.bundle',
    path: path.resolve('./dist/dev/'),
    // you must set publicPath to load hmr chunk
    publicPath: 'http://localhost:38989/',
    globalObject: '(0, eval)("this")',
  },
  plugins: [
    new VueLoaderPlugin(),
    new HippyHMRPlugin(),
    // other plugin here
  ],
  module: {
    rules: [
      {
        test: /\.vue$/,
        use: [
          vueLoader,
        ],
      },
    ],
    // other loaders
  }
}

Readme

Keywords

Package Sidebar

Install

npm i @hippy/hippy-hmr-plugin

Weekly Downloads

20

Version

0.1.1

License

Apache-2.0

Unpacked Size

8.81 kB

Total Files

5

Last publish

Collaborators

  • raypro
  • zealotchen
  • xuqingkuang
  • zoomchan-cxj
  • ilikethese
  • ivanfanwu
  • chestershen