awesome-webextension / webpack-target-webextension

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

Webpack 5 compatibility #2

Closed Jack-Works closed 3 years ago

Jack-Works commented 4 years ago

This library depends on webpack/lib/FunctionModulePlugin but it is removed in Webpack 5

crimx commented 4 years ago

The code of the custom target is based on "web" target in Webpack 4 which is the Webpack version that Neutrinojs is depending.

crimx commented 4 years ago

Once Webpack 5 is mature enough and is wildly adopted by Neutrino presets the code should change accordingly.

Jack-Works commented 4 years ago

hi, @crimx webpack 5 has released!

crimx commented 4 years ago

hi, @crimx webpack 5 has released!

Good to know! Would you like to make a PR? Since my projects are based on Neutrino which is still on 4, I am not in a hurry to upgrade to Webpack 5 until my next new project.

Jack-Works commented 4 years ago

Ah I'm not familiar with webpack internal. Maybe I need to test if writeToDisk in webpack 5 still works

A-gambit commented 4 years ago

Hey @crimx. Do you have a plan to switch it to Webpack 5?

crimx commented 4 years ago

Not at the moment unfortunately. Still waiting for neutrinojs.

For browser extension development webpack 4 is more than enough though.

A-gambit commented 4 years ago

Thank you for your quick answer.

But if we will think in the direction technology X is more than enough for something we will still use grunt for our codebase. Haha

Anyway, Webpack 5 gives a lot of improvements in tree-shacking which can be helpful.

crimx commented 4 years ago

But if we will think in the direction technology X is more than enough for something we will still use grunt for our codebase.

If it works well I don't see anything wrong with using grunt which is still a powerful tool.

Webpack 5 gives a lot of improvements in tree-shacking which can be helpful.

In browser extension bundle size has very little impact since they are loaded from the filesystem.

Jack-Works commented 4 years ago

I like new new Worker("./x.js", import.meta.url) and new URL('./x.png', import.meta.url) support in Webpack 5, hope I can use it so it would be nice to upgrade to 5