Back to Hippy

Hippy Vue Loader

driver/js/packages/hippy-vue-loader/README.md

3.4.01.3 KB
Original Source

Hippy Vue Loader

This is a fork of [email protected] for supporting hippy css HMR.

Add style hot reload hook and repaint API to repaint component when HMR.

How to use

This loader should be used together with hippy hmr plugin and hipp debug server, an example webpack config like this:

js
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/'),
    globalObject: '(0, eval)("this")',
  },
  plugins: [
    new VueLoaderPlugin(),
    new HippyHMRPlugin({
      // HMR [hash].hot-update.json will fetch from this path
      hotManifestPublicPath: 'http://<your_ip_or_localhost_with_proxy>:38989/',
    }),
    // other plugin here
  ],
  module: {
    rules: [
      {
        test: /\.vue$/,
        use: [
          vueLoader,
        ],
      },
    ],
    // other loaders
  }
}