Repository navigation
Use webpack 5.111 native CSS and HTML support - #2835
sylvesterkaczmarek wants to merge 7 commits into
Conversation
|
Could you add output.copy to this pr too? |
|
Added in c7a310d: the remaining CopyWebpackPlugin patterns now use Webpack 5.111 native output.copy, and copy-webpack-plugin has been removed. Fresh npm ci, lint, and production build pass; the Tesseract and Forge assets are still emitted at the expected paths. |
|
We always allow an absolute minimum of 24 hours for new/updated dependencies for any supply chain issues to materialise (direct flagging from @evenstensberg notwithstanding) so I'll take a look at this one tomorrow. |
|
@GCHQDeveloper581 Sorry, didn’t know! ic-ui-kit has been doing 3 days min age, which I think is very smart if releases are on Friday and/or to have a good time window for vulnerable packages to be flagged by GitHub or other CVE authorities |
|
@evenstensberg - nothing to apologise for, and we really appreciate your flagging the new release to us. I was simply intending to explain why I wasn't going to go further with this until a little time had elapsed. |
|
Mainainer due diligence: Side comment: it is good to see just how many sub-dependencies this update has removed - package-lock.json has seen a net loss of ~550 lines. |
|
Thanks for checking the dependency supply-chain side. The reduction in transitive dependencies is a useful side effect of the move to the native Webpack features as well. |
|
@evenstensberg - this is still creating Javascript files with names like __html_7071452b_0.js which will hit the same issue as we did with css in #2794. Any pointers? |
|
We will have a look, but you need to push this pr branch somewhere so we can reproduce the issue on our end |
|
@sylvesterkaczmarek could you invite me to a contributor on your fork? |
|
Meanwhile: @sylvesterkaczmarek could you try to set
Also set this option: |
output: {
chunkFilename: 'gchq.[name].chunk.js',
},
optimization: {
chunkIds: 'named'
}, |
|
Tracked this down and fixed it in |
|
@sylvesterkaczmarek could you rebase? |
04c8d8a to
6b451cf
Compare
|
Rebased onto current |
|
Looks like you're all set. If the team needs help in terms of webpack or build infra, send me a message or email. Happy to help @GCHQDeveloper581. Thanks for implementing @sylvesterkaczmarek! |
|
@sylvesterkaczmarek could you rebase? |
67dc0c6 to
a12b09a
Compare
|
Done. Rebased cleanly onto current master (fb95859) and force-pushed with lease. The PR now contains the same six feature commits only, with SSH signatures preserved. New head is a12b09a. Fresh local validation passes: npm ci, npm run lint, and the full npm run build (webpack 5.111.1 compiled successfully). |
|
Revalidated the current 0-behind, SSH-verified branch with its exact dependency graph: |
a12b09a to
b90bee7
Compare
|
Rebased onto current master and resolved the dependency drift by retaining upstream webpack-bundle-analyzer 5.4.0 while keeping this PR on webpack ^5.111.0; the regenerated lock resolves webpack 5.111.1. All six feature commits were rewritten with the same SSH signing key and GitHub reports every commit Verified. Fresh npm ci, full lint, and the production build pass; webpack 5.111.1 compiles successfully. Manual output verification also passes: index.html references the emitted hashed .ico asset, there are no raw __* output files, and the expected gchq._html* synthetic chunks are emitted. git diff --check is clean and the branch is 0 behind. |
|
@GCHQDeveloper581 This PR is current with master and already has @evenstensberg approval. Fresh npm ci, lint, production build, and manual emitted-asset verification are clean; there are no unresolved review threads or failing checks. The branch policy still reports review required. Could you provide the additional review when convenient? |
|
@sylvesterkaczmarek while waiting, could you replace html-webpack plugin in ic-ui-kit with the native implementation? |
Yes. On it. |
|
Done: mi6/ic-ui-kit#4701 I replaced html-webpack-plugin in the React performance harness with Webpack's native HTML entry support, removed the plugin/transitive dependency stack, and pinned Webpack ^5.111.0 directly. The locked 5.111.1 production build emits index.html + index.js cleanly with no raw __* outputs. |
b90bee7 to
f7dbb55
Compare
|
@evenstensberg @GCHQDeveloper581 Refreshed this approved PR onto current |
|
@GCHQDeveloper581 The current revision is |
|
@GCHQDeveloper581 Could you review the current webpack revision and authorise its PR workflow? The Node 24/26 checks are still waiting to run. |
|
@sylvesterkaczmarek could you try this option for naming the html chunks? https://webpack.js.org/blog/2026-10-13-webpack-5-112/#name-the-chunks-in-your-html |
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Replace copy-webpack-plugin with Webpack 5.111 output.copy while preserving the existing Tesseract and Forge asset mappings. Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
f7dbb55 to
cad8e59
Compare
|
Tried the webpack 5.112 HTML chunk naming option. The old _html* filename special-case is gone; generated chunks now have stable gchq.* names and all HTML references resolve. Rebased on master; lint, build, 279 Node API tests and 2,327 operation tests pass. |
Fixes #2792.
Use webpack's native CSS/HTML support instead of
css-loader,mini-css-extract-pluginandhtml-webpack-plugin.Updated to webpack 5.112 and use
module.parser.html.chunkNamefor stable HTML script names, replacing the manual__html_*filename workaround. Existing module bundle paths and build-time HTML placeholders are retained.Verified:
npm ci,npm run lint,npm run build(webpack 5.112.0), andnpm test(279 Node API and 2,327 operation tests). All three generated HTML script references resolve; no raw__html_*files.