forge icon indicating copy to clipboard operation
forge copied to clipboard

feat(plugin-webpack): Package all webpack `externals` and their dependencies

Open timfish opened this issue 3 years ago • 2 comments

  • [x] I have read the contribution documentation for this project.
  • [x] I agree to follow the code of conduct that this project follows, as appropriate.
  • [ ] The changes are appropriately documented (if applicable).
  • [ ] The changes have sufficient test coverage (if applicable).
  • [ ] The testsuite passes successfully on my local machine (if applicable).

This brings the functionality of this plugin and enables it by default.

  • Collects Webpack externals from both main and renderer configs
  • Finds all their dependencies using flora-colossus
  • Ensures the correct directories in node_modules get included in the packaged app

This makes it particularly easy to get native modules working if they don't work well with Webpack. You just add them to Webpack externals and everything should work.

Notes:

  • This doesn't work with monorepos with hoisted modules
  • It currently uses private fields and methods of flora-colossus
  • Not yet tested in combination with Vercel loader

timfish avatar Jun 28 '21 21:06 timfish

@timfish, thank you so much for it, do you know when will this get merged?

augustnmonteiro avatar Feb 10 '22 15:02 augustnmonteiro

This PR is not finished and I haven't got time to finish at the moment.

Anyone else is welcome to take the reins though!

timfish avatar Feb 10 '22 15:02 timfish