|
1 | 1 | const { runWebpackCompiler } = require("./compiler");
|
2 | 2 |
|
3 |
| -module.exports = function ($logger, $liveSyncService, hookArgs) { |
4 |
| - if (hookArgs.config) { |
5 |
| - const appFilesUpdaterOptions = hookArgs.config.appFilesUpdaterOptions; |
6 |
| - if (appFilesUpdaterOptions.bundle) { |
7 |
| - const platforms = hookArgs.config.platforms; |
8 |
| - return Promise.all(platforms.map(platform => { |
9 |
| - const env = hookArgs.config.env || {}; |
10 |
| - const config = { |
11 |
| - env, |
12 |
| - platform, |
13 |
| - bundle: appFilesUpdaterOptions.bundle, |
14 |
| - release: appFilesUpdaterOptions.release, |
15 |
| - watch: true |
16 |
| - }; |
| 3 | +module.exports = function ($logger, $liveSyncService, $options, hookArgs) { |
| 4 | + if (hookArgs.config) { |
| 5 | + const appFilesUpdaterOptions = hookArgs.config.appFilesUpdaterOptions; |
| 6 | + if (appFilesUpdaterOptions.bundle) { |
| 7 | + const platforms = hookArgs.config.platforms; |
| 8 | + return Promise.all(platforms.map(platform => { |
| 9 | + const env = hookArgs.config.env || {}; |
| 10 | + env.hmr = !!$options.hmr; |
| 11 | + const config = { |
| 12 | + env, |
| 13 | + platform, |
| 14 | + bundle: appFilesUpdaterOptions.bundle, |
| 15 | + release: appFilesUpdaterOptions.release, |
| 16 | + watch: true |
| 17 | + }; |
17 | 18 |
|
18 |
| - return runWebpackCompiler(config, hookArgs.projectData, $logger, $liveSyncService, hookArgs); |
19 |
| - })); |
20 |
| - } |
21 |
| - } |
| 19 | + return runWebpackCompiler(config, hookArgs.projectData, $logger, $liveSyncService, hookArgs); |
| 20 | + })); |
| 21 | + } |
| 22 | + } |
22 | 23 | }
|
0 commit comments