diff options
Diffstat (limited to 'src/index.html')
-rw-r--r-- | src/index.html | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/index.html b/src/index.html index 9e5acd705..5ce7f6a96 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -11,10 +11,15 @@ | |||
11 | <div class="dev-warning">DEV MODE</div> | 11 | <div class="dev-warning">DEV MODE</div> |
12 | <div id="root"></div> | 12 | <div id="root"></div> |
13 | <script> | 13 | <script> |
14 | document.querySelector('body').classList.add(process.platform); | 14 | document.querySelector('body').classList.add(process.env.OS_PLATFORM ? process.env.OS_PLATFORM : process.platform); |
15 | 15 | ||
16 | const { isDevMode } = require('./environment'); | 16 | const { isDevMode } = require('./environment'); |
17 | if (isDevMode) { | 17 | if (isDevMode) { |
18 | const debugging = require('debug'); | ||
19 | debugging.enable(process.env.DEBUG); | ||
20 | |||
21 | const debug = debugging('Index'); | ||
22 | |||
18 | document.querySelector('body').classList.add('isDevMode'); | 23 | document.querySelector('body').classList.add('isDevMode'); |
19 | 24 | ||
20 | (function() { | 25 | (function() { |
@@ -25,7 +30,7 @@ | |||
25 | document.body.appendChild(s); | 30 | document.body.appendChild(s); |
26 | 31 | ||
27 | s.onload = () => { | 32 | s.onload = () => { |
28 | console.log('livereload loaded'); | 33 | debug('livereload loaded'); |
29 | const originalReloadBehaviour = window._onLiveReloadFileChanged; | 34 | const originalReloadBehaviour = window._onLiveReloadFileChanged; |
30 | 35 | ||
31 | window._onLiveReloadFileChanged = (file) => { | 36 | window._onLiveReloadFileChanged = (file) => { |
@@ -33,10 +38,10 @@ | |||
33 | originalReloadBehaviour(file); | 38 | originalReloadBehaviour(file); |
34 | } else { | 39 | } else { |
35 | if (file.path.includes('/build/webview/')) { | 40 | if (file.path.includes('/build/webview/')) { |
36 | console.log('Livereload: Reloading all webvies'); | 41 | debug('Livereload: Reloading all webvies'); |
37 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); | 42 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); |
38 | } else { | 43 | } else { |
39 | console.log('Livereload: skip reload as only main process files have changed'); | 44 | debug('Livereload: skip reload as only main process files have changed'); |
40 | } | 45 | } |
41 | } | 46 | } |
42 | } | 47 | } |