Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 1790925

Browse files
committed
fix-next: pass --env.hmr only if the --hmr flag is raised
1 parent 4459cce commit 1790925

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/before-prepareJS.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ const { runWebpackCompiler } = require("./compiler");
22

33
module.exports = function ($logger, $liveSyncService, $options, hookArgs) {
44
const env = hookArgs.config.env || {};
5-
env.hmr = !!$options.hmr;
5+
if ($options.hmr) {
6+
env.hmr = true;
7+
}
8+
69
const platform = hookArgs.config.platform;
710
const appFilesUpdaterOptions = hookArgs.config.appFilesUpdaterOptions;
811
const config = {

lib/before-watch.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ module.exports = function ($logger, $liveSyncService, $options, hookArgs) {
77
const platforms = hookArgs.config.platforms;
88
return Promise.all(platforms.map(platform => {
99
const env = hookArgs.config.env || {};
10-
env.hmr = !!$options.hmr;
10+
if ($options.hmr) {
11+
env.hmr = true;
12+
}
13+
1114
const config = {
1215
env,
1316
platform,

0 commit comments

Comments
 (0)