diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2020-04-28 12:34:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-28 18:34:05 +0200 |
| commit | cb2b4e3522cb7f426ba5ad3e68deb9e6ccc581ec (patch) | |
| tree | 2a2f38823c3c9f0b5439ce2aa7c9040299109292 /electron/.electron-vue/dev-client.js | |
| parent | eb526927e16954390d06929535d6f5c3766b5f6c (diff) | |
electron simulator (#531)
Diffstat (limited to 'electron/.electron-vue/dev-client.js')
| -rw-r--r-- | electron/.electron-vue/dev-client.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/electron/.electron-vue/dev-client.js b/electron/.electron-vue/dev-client.js new file mode 100644 index 00000000..2913ea4b --- /dev/null +++ b/electron/.electron-vue/dev-client.js @@ -0,0 +1,40 @@ +const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') + +hotClient.subscribe(event => { + /** + * Reload browser when HTMLWebpackPlugin emits a new index.html + * + * Currently disabled until jantimon/html-webpack-plugin#680 is resolved. + * https://github.com/SimulatedGREG/electron-vue/issues/437 + * https://github.com/jantimon/html-webpack-plugin/issues/680 + */ + // if (event.action === 'reload') { + // window.location.reload() + // } + + /** + * Notify `mainWindow` when `main` process is compiling, + * giving notice for an expected reload of the `electron` process + */ + if (event.action === 'compiling') { + document.body.innerHTML += ` + <style> + #dev-client { + background: #4fc08d; + border-radius: 4px; + bottom: 20px; + box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3); + color: #fff; + font-family: 'Source Sans Pro', sans-serif; + left: 20px; + padding: 8px 12px; + position: absolute; + } + </style> + + <div id="dev-client"> + Compiling Main Process... + </div> + ` + } +}) |
