Closed dzgcsmthmt closed 1 month ago
config:
hotReloadExtension({
log: true,
backgroundPath: 'src/pages/content/index.ts'
}),
Hey @dzgcsmthmt,
backgroundPath
in config should always point to service worker file. It is where reload function is injected.
As for the content script to reload, You should build the content script file on the vite.config.ts
where you have hot-reload-extension-vite-plugin
initialised with backgroundPath
pointing to service worker file. Then, the plugin will detect change in content script file and reload the extension.
Here is the example where reloading in content script works. Please check vite.config.ts on this example project.
There may be some complex scenario which this plugin might not have covered. If so, I am happy to extend as required.
in background and panel index.js,it is ok,but in content.js,chrome.runtime.onStartup && chrome.runtime.onInstalled undefined