Skip to content

Support crypto quirks in Node for codesandbox #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/app1/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ const ModuleFederationPlugin = require("webpack").container
.ModuleFederationPlugin;
const path = require("path");

// some webpack5/Node18 quirk, better than going with legacy openssl provider :shrug:
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);

module.exports = {
entry: "./index.js",
mode: "development",
Expand All @@ -12,7 +17,8 @@ module.exports = {
port: 1337
},
output: {
publicPath: "auto"
publicPath: "auto",
hashFunction: "sha256"
},
module: {
rules: [
Expand Down
8 changes: 7 additions & 1 deletion packages/app2/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");

const { ModuleFederationPlugin } = webpack.container;

// some webpack5/Node18 quirk, better than going with legacy openssl provider :shrug:
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);

module.exports = {
entry: "./index.js",
mode: "development",
Expand All @@ -13,7 +18,8 @@ module.exports = {
port: 1338
},
output: {
publicPath: "auto"
publicPath: "auto",
hashFunction: "sha256"
},
module: {
rules: [
Expand Down
8 changes: 7 additions & 1 deletion packages/store/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");

const { ModuleFederationPlugin } = webpack.container;

// some webpack5/Node18 quirk, better than going with legacy openssl provider :shrug:
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);

module.exports = {
// no entry
entry: {},
Expand All @@ -14,7 +19,8 @@ module.exports = {
port: 1339
},
output: {
publicPath: "auto"
publicPath: "auto",
hashFunction: "sha256"
},
module: {
rules: [
Expand Down
Loading