forge
forge copied to clipboard
Regression in v7.8.1: `index.html` no longer listed in Webpack assets
Pre-flight checklist
- [x] I have read the contribution documentation for this project.
- [x] I agree to follow the code of conduct that this project uses.
- [x] I have searched the issue tracker for a bug that matches the one I want to file, without success.
Forge version
7.8.1
Electron version
36.4.0
Operating system
Windows 10 (19045.5854)
Last known working Forge version
7.8.0
Expected behavior
Webpack plugins see my renderer's index.html as an asset when calling compilation.getAssets().
Actual behavior
Starting with Forge v7.8.1, Webpack plugins do not see my renderer's index.html as an asset when calling compilation.getAssets() on Windows. (It works fine on macOS.)
This broke the build script of my app.
Steps to reproduce
- Clone https://github.com/nikwen/forge-jiti-bug
npm installnpm start- The output is:
(This is the list of assets that Webpack plugins see on Forge v7.8.1.)main_window/preload.js main_window/index.js git checkout forge-v7.8.0- This branch has one additional commit d5ef061: Downgrading Forge to v7.8.0
npm installnpm start- The output is:
(This is the expected behavior — the list of assets that Webpack plugins see on Forge v7.8.0.)main_window/preload.js main_window/index.js main_window/index.html
Additional information
- This works fine on macOS.
- This was introduced by https://github.com/electron/forge/pull/3907 (the
jitiPR). - It broke the build script of my app.
- Workaround: renaming
forge.config.tstoforge.config.tsx(becausejitiisn't used for.tsxfiles)
I think this is the root cause:
On v7.8.0, Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER is 3000.
On v7.8.1, Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER is undefined.
If I set stage: undefined on v7.8.0, I get the same behavior there.
v7.8.1 imports Compilation as a function whereas v7.8.0 imports Compilation as an object.