awesome-webextension / webpack-target-webextension

WebExtension Target for Webpack 5. Supports code-splitting and HMR.
MIT License
44 stars 5 forks source link

Does HMR works on this target? #3

Closed Jack-Works closed 3 years ago

Jack-Works commented 3 years ago

https://github.com/crimx/webpack-target-webextension/blob/master/lib/WebExtMainTemplatePlugin.js#L522

I have debugged into the webpack and it seems like this library doesn't return a template that web extension can run on.

crimx commented 3 years ago

To enable HMR you have to run in fake env like what neutrino-webextension did. Real extension env does not support HMR.

Jack-Works commented 3 years ago

It does support. You just have to do some tweaks.

Jack-Works commented 3 years ago

I'd like to PR for HMR. Is that OK?

crimx commented 3 years ago

I'd like to PR for HMR. Is that OK?

That would be great! PRs are welcomed.

Jack-Works commented 3 years ago

@crimx hi plz review and try it!

crimx commented 3 years ago

Great! I'll look into it as soon as possible.

Jack-Works commented 3 years ago

As you can see in the PR, I require some changes in the webpack config. Does that possible to auto-apply them in the plugin? @crimx