Repository navigation
build: drop --openssl-legacy-provider so the build works on Node 16 through 23 (#896) - #900
Merged
Merged
Conversation
#896) file-loader/url-loader name emitted files with loader-utils getHashDigest, which calls crypto.createHash('md4'). OpenSSL 3 rejects MD4 unless node runs with --openssl-legacy-provider, and node builds on OpenSSL 1.1 refuse that flag in NODE_OPTIONS, so the unconditional flag in the build scripts broke one group or the other. - Handle fonts and images with webpack 5 asset modules (asset for woff/woff2 with the same 10000 byte inline limit, asset/resource for the rest) in webpack.config.js and webpack.config.library.js. - Set output.hashFunction to xxhash64 so no MD4 is used anywhere. - Remove NODE_OPTIONS=--openssl-legacy-provider from build and build:library. - Add engines.node >=16.20.2 and .nvmrc (22). This also fixes a latent bug: woff/woff2 matched both the url-loader and file-loader rules, so the CSS pointed at data: URIs holding file-loader's JS output instead of the font files; browsers fell back to ttf/eot. The woff/woff2 references now resolve to the emitted files.
Content-hashed asset and chunk names changed with the move off MD4, so set output.clean in the app webpack config to stop stale files piling up in dist/. Add 22.x to the CI matrix to match .nvmrc.
This was referenced Oct 6, 2026
webpack build does not clean dist/ (risk of serving a partial/mixed bundle on in-place rebuild)
#898
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #896. Fixes #898.
yarn buildused to setNODE_OPTIONS=--openssl-legacy-providerunconditionally. Node 16 rejects that flag, and on Node 17+ (OpenSSL 3) the flag was only needed because url-loader/file-loader hash font and image file names with MD4.Changes:
assetwith a 10 KB inline limit for woff/woff2,asset/resourcefor everything else) instead of url-loader/file-loader.output.hashFunction: "xxhash64"in both webpack configs, so no MD4 is used anywhere.buildandbuild:libraryno longer set NODE_OPTIONS.engines.node >=16.20.2, and a.nvmrc(22).output.clean: truein the app config (webpack build does not clean dist/ (risk of serving a partial/mixed bundle on in-place rebuild) #898), so dist/ no longer keeps stale hashed files. Webpack removes them at emit time, and a failed build leaves dist/ untouched. The library config deliberately does not clean, because both configs write to dist/ and a library build would otherwise wipe the app build.Verified locally:
yarn buildsucceeds on Node 16.20.2, 18, 22 and 23.3.0, andyarn testpasses (5/5). In headless Chromium, the fonts, icons and images on /busted load the same as on the current live build, with no failed requests.Deploy note: asset and chunk file names change with this PR (for example,
754.jsbecomes145.js, and fonts and images get new hashed names). If dist is built elsewhere and copied into the live checkout, usersync -a --deleteso the old files don't pile up. They are harmless if left behind.