forge icon indicating copy to clipboard operation
forge copied to clipboard

feat(plugin-webpack): customize `HtmlWebpackPlugin` options

Open sgammon opened this issue 3 years ago • 6 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.
  • [x] The changes are appropriately documented (if applicable).
  • [x] The changes have sufficient test coverage (if applicable).
  • [x] The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

This changeset adds options to entrypoints to support customized operation of the HtmlWebpackPlugin. See below for full changeset.

Changes enclosed:

  • Add properties for output, htmlPlugins, and htmlOptions to WebpackPluginEntryPoint
  • Use new options from Config.ts, by merging them into their expected places

Fixes and closes electron-userland/electron-forge#2968.

sgammon avatar Oct 16 '22 03:10 sgammon

i see what seems like a flaky test locally (unrelated), and i'm unclear about how i might reach into the HtmlWebpackPlugin to test some of these options, so i left it at a test for output. i'm happy to amend to update docs and tests.

sgammon avatar Oct 16 '22 03:10 sgammon

Codecov Report

Merging #2969 (6565ca7) into main (362099a) will increase coverage by 0.03%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2969      +/-   ##
==========================================
+ Coverage   73.80%   73.84%   +0.03%     
==========================================
  Files          66       66              
  Lines        2142     2145       +3     
  Branches      424      427       +3     
==========================================
+ Hits         1581     1584       +3     
  Misses        356      356              
  Partials      205      205              
Impacted Files Coverage Δ
packages/plugin/webpack/src/WebpackConfig.ts 98.76% <100.00%> (+0.04%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 362099a...6565ca7. Read the comment docs.

codecov[bot] avatar Oct 16 '22 04:10 codecov[bot]

i should also say, @MarshallOfSound, i have some background material on the linked issue, #2698. the alternatives listed there were considered but imagined to be suboptimal. thank you for all your hard work on this library, and for the lightning fast review -- it makes working with Electron so easy and smooth!

sgammon avatar Oct 16 '22 07:10 sgammon

accidental close (fat thumb)

sgammon avatar Oct 16 '22 07:10 sgammon

What is blocking this PR from beeing merged? It would be very useful for us 🙏🏼

Pajn avatar Sep 21 '23 13:09 Pajn

Hi, Can we expect to have something merge on this? I bet it will be useful for a lot of us, and it could helps to send our own variables to our template, which is not the cas as of today. thanks,

elvince avatar Feb 09 '24 17:02 elvince