hmr-loader

1.0.5 • Public • Published

webpack-module-hot-accept

Tiny webpack plugin that adds module.hot.accept to the bottom of modules if module.hot is not already present.

Installation

npm install hmr-loader --save-dev

Usage

// webpack.config.js
 
var webpack = require('webpack');
 
module.exports = {
  entry: [
    'webpack/hot/only-dev-server',
    './entry.js'
  ],
  output: {
    filename: 'bundle.js'
  },
  plugins: [
    new webpack.NoErrorsPlugin()
  ],
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        exclude: /node_modules/,
        loaders: [
          'babel',
          'hmr' // add this last
        ]
      }
    ]
  }
};
 

仅为方便使用

Package Sidebar

Install

npm i hmr-loader

Weekly Downloads

2

Version

1.0.5

License

MIT

Last publish

Collaborators

  • jso0