javascript - Using webpack's ProvidePlugin causes Hot Module Replacement to be disabled -
i using generator-react-webpack , when trying use webpack's provideplugin following error when browser launches after doing npm start:
uncaught error: [hmr] hot module replacement disabled.
here cfg/base.js config file being imported webpack.config.js file. if remove plugins section works ok. doing wrong?
'use strict'; let path = require('path'); let webpack = require('webpack'); let port = 8000; let srcpath = path.join(__dirname, '/../src'); let publicpath = '/assets/'; let additionalpaths = []; module.exports = { plugins: [ new webpack.provideplugin({ $: 'jquery', _: 'lodash' }) ], additionalpaths: additionalpaths, port: port, debug: true, output: { path: path.join(__dirname, '/../dist/assets'), filename: 'app.js', publicpath: publicpath }, devserver: { contentbase: './src/', historyapifallback: true, hot: true, port: port, publicpath: publicpath, noinfo: false }, resolve: { extensions: ['', '.js', '.jsx'], alias: { actions: srcpath + '/actions/', components: srcpath + '/components/', sources: srcpath + '/sources/', stores: srcpath + '/stores/', styles: srcpath + '/styles/', config: srcpath + '/config/' + process.env.react_webpack_env } }, module: { preloaders: [{ test: /\.(js|jsx)$/, include: srcpath, loader: 'eslint-loader' }], loaders: [{ test: /\.css$/, loader: 'style-loader!css-loader' }, { test: /\.sass/, loader: 'style-loader!css-loader!sass-loader?outputstyle=expanded&indentedsyntax' }, { test: /\.scss/, loader: 'style-loader!css-loader!sass-loader?outputstyle=expanded' }, { test: /\.less/, loader: 'style-loader!css-loader!less-loader' }, { test: /\.styl/, loader: 'style-loader!css-loader!stylus-loader' }, { test: /\.(png|jpg|gif|woff|woff2)$/, loader: 'url-loader?limit=8192' }] } };
Comments
Post a Comment