New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hot Module Reload (HMR) for Content Scripts #426
Comments
Ah, I didn't know Thanks, I will see what I can do. |
@Kocal A quick update, I just realised that there might have been a problem with webpack.config.js configuration, not the outdated version. Before I had a file structure where I would keep my content script files in a separate folder such as Apparently, the plugin doesn't like this configuration with paths, so HMR for content scripts didn't work in this case. Now when I move content-script1.js to root folder and change webpack.config.js to the this - |
And what if you configure the plugin with the plugins: [
new ExtensionReloader({
manifest: path.resolve(__dirname, "manifest.json")
})
] if I'm not wrong, it should read background/content scripts paths from |
Well I got it working properly. I'm not sure it's because I've migrated the plugin or used the |
@Kocal thanks for the update, I'll try to implement this in my project. Looking at your commit, everything seems crystal clear except the yarn.lock file update cos I'm not familiar with yarn. So far I've been using npm only. If I'm using npm, should I bother about yarn.lock file at all? |
Nope you can totally use NPM instead of yarn for this 👍 |
Describe the bug
Outdated webpack-chrome-extension-reloader plugin version.
To Reproduce
Follow the steps from README documentation to install fresh boilerplate.
Expected behavior
After reading some information about webpack-chrome-extension-reloader plugin, and asking a question to @rubenspgcavalcante, I realised that HMR should work for content scripts too.
Solution
Update webpack-chrome-extension-reloader plugin version from 0.8.3 to 1.3.0 in the package.json file.
Result
Now when I make any changes in the content-script.js file, extension along with the browser page gets reloaded without any problems. So much easier to work now.
The text was updated successfully, but these errors were encountered: