Hot-Reload not working in background.js dependencies
See original GitHub issueDescribe the bug Hot-Reload wont work when despondencies of background.js changed.
To Reproduce Steps to reproduce the behavior:
// src/background.ts
'use strict'
import path from 'path'
import { app, protocol, BrowserWindow, Tray, Menu, Notification } from 'electron'
import { createProtocol, installVueDevtools } from 'vue-cli-plugin-electron-builder/lib'
import { getConfig } from './common/config'
const isDevelopment = process.env.NODE_ENV !== 'production'
protocol.registerSchemesAsPrivileged([{ scheme: 'app', privileges: { secure: true, standard: true } }])
let win: BrowserWindow | null
function createWindow () {
...
}
if (app.requestSingleInstanceLock()) {
app.on('ready', async () => {
... // Install Vue Devtools
const config = getConfig()
if (!config.hideOnStart) {
createWindow()
}
})
...
} else {
app.quit()
}
// src/common/config.ts
export function getConfig(){
...
}
Edit src/common/config.ts
, but the background process wont be reloaded
Expected behavior
background process should be reloaded after its dependencies updated
Screenshots
Environment (please complete the following information):
- OS and version:
Microsoft Windows [Version 10.0.18363.778]
- node version:
v14.2.0
- npm version:
6.14.4
- yarn version (if used):
1.22.4
- vue-cli-plugin-electron-builder version :
^1.4.6
- electron version: 8.2.5 (but the bug happens on all electron versions!)
- other vue plugins used: babel, eslint, router, typescript, vuetify
- custom config for vcp-electron-builder: https://github.com/ZhangZisu/classroom-helper/blob/master/vue.config.js
- (if possible) link to your repo: https://github.com/ZhangZisu/classroom-helper
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Changes to transitive dependencies not triggering live reload
The LiveReload/HMR works as expected when changing the directly imported stylus file. It does not work when changing anything in the colors.styl ...
Read more >chrome-extension-hot-reload - npm package
This is an npm package that can be imported in background.js and popup.js files to make hot reloading possible in extensions. Using this...
Read more >MV3 service worker broken after auto-update and manual ...
Steps to reproduce the problem: 1.manual refresh extension 2.open new tab page and check service worker first time it should work ```js
Read more >How to make your Node.js app restart automatically when you ...
This guide would show you how you can make your Node.js application reload automatically whenever you make changes to your code during ...
Read more >live-server
No reload on changes. Open your browser's console: there should be a message at the top stating that live reload is enabled. Note...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You need to add the file to the
mainProcessWatch
array invue.config.js
:@BroJenuel no, glob files are not supported for mainProcessWatch. However, you can add directories to that list and all contents will be watched.