如何在生产环境中打包时删除所有HMR引用?
我的生产Webpack配置没有任何关于HMR的引用,但是在浏览器调试器中,客户端不断地向/__webpack_hmr发出xhr调用。
有人能解释一下吗?
-- 我的配置
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: [
path.resolve(__dirname, 'master/jsx/App')
],
output: {
path: path.resolve(__dirname, 'build'),
publicPath: '/dist/',
filename: 'app.bundle.js'
},
cache: false,
devtool: 'sourcemap',
resolve: {
extensions: ['', '.js', '.jsx']
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
],
module: {
loaders: [{
test: /\.jsx?$/,
exclude: /node_modules/
}, {
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'react'],
compact: false
}
}, {
test: /\.css$/,
loader: "style-loader!css-loader"
}, {
test: /\.woff|\.woff2|\.svg|.eot|\.ttf/,
loader: 'url?prefix=font/&limit=10000'
}]
}
};