Skip to content

Commit

Permalink
Enable CI to pass with node v18+ (#16344)
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill authored Dec 13, 2022
1 parent e1ff5d2 commit fee84e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ const AliasPlugin = require('enhanced-resolve/lib/AliasPlugin')
const buildConfigs = ['Component', 'Static', 'Debug', 'Release']
const extraArchitectures = ['arm64', 'x86']

// OpenSSL 3 no longer supports the insecure md4 hash, but webpack < 5.54.0
// hardcodes it. Work around by substituting a supported algorithm.
// https://github.com/webpack/webpack/issues/13572
// https://github.com/webpack/webpack/issues/14532
// TODO(petemill): Remove this patching when webpack > 5.54.0 is being used.
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);

function getBuildOuptutPathList(buildOutputRelativePath) {
return buildConfigs.flatMap(config => [
path.resolve(__dirname, `../../out/${config}/${buildOutputRelativePath}`),
Expand Down
3 changes: 2 additions & 1 deletion components/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ const pathMap = require('./path-map')

const tsConfigPath = path.join(process.env.ROOT_GEN_DIR, 'tsconfig-webpack.json')

// OpenSSL 3 no longer supports the insecure md4 hash, but webpack < 6
// OpenSSL 3 no longer supports the insecure md4 hash, but webpack < 5.54.0
// hardcodes it. Work around by substituting a supported algorithm.
// https://github.com/webpack/webpack/issues/13572
// https://github.com/webpack/webpack/issues/14532
// TODO(petemill): Remove this patching when webpack > 5.54.0 is being used.
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
Expand Down

0 comments on commit fee84e2

Please sign in to comment.