非开发模式不会导入hmr开发服务器,测试打包结果完成
This commit is contained in:
parent
48ea930c00
commit
1705f5fd07
|
|
@ -238,9 +238,9 @@ module.exports = function (webpackEnv) {
|
|||
// This means they will be the "root" imports that are included in JS bundle.
|
||||
entry: [
|
||||
// 模块热替换的运行时代码
|
||||
'webpack/hot/dev-server.js',
|
||||
...(!!isEnvDevelopment? ['webpack/hot/dev-server.js',
|
||||
// 用于 web 套接字传输、热重载逻辑的 web server 客户端
|
||||
'webpack-dev-server/client/index.js?hot=true&live-reload=true',
|
||||
'webpack-dev-server/client/index.js?hot=true&live-reload=true'] : []),
|
||||
// oak项目入口
|
||||
paths.appIndexJs,
|
||||
],
|
||||
|
|
@ -813,7 +813,7 @@ module.exports = function (webpackEnv) {
|
|||
)
|
||||
),
|
||||
// 添加HMR插件支持
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
!!isEnvDevelopment && new webpack.HotModuleReplacementPlugin(),
|
||||
// Inlines the webpack runtime script. This script is too small to warrant
|
||||
// a network request.
|
||||
// https://github.com/facebook/create-react-app/issues/5358
|
||||
|
|
|
|||
Loading…
Reference in New Issue