Skip to content

Commit

Permalink
[ARGG-777]: Added comments to fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Sannikov committed Nov 6, 2023
1 parent 85fc003 commit 90e852d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ module.exports = function (webpackEnv) {
...require('../backpack-addons/externals').externals(isEnvProduction), // #backpack-addons externals
resolve: {
fallback: {
// Falling back to false as these features are not expected to be used by browsers, and node will have native imports to resolve them
util: false,
assert: false,
crypto: false,
Expand Down
11 changes: 6 additions & 5 deletions packages/react-scripts/config/webpack.config.ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,15 @@ module.exports = function (webpackEnv) {
},
...require('../backpack-addons/externals').ssrExternals(), // #backpack-addons externals
resolve: {
// Falling back to false as these features are not expected to be used by browsers, and node will have native imports to resolve them
fallback: {
util: false,
assert: false,
crypto: require.resolve('crypto-browserify'),
domain: require.resolve('domain-browser'),
path: require.resolve('path-browserify'),
stream: require.resolve('stream-browserify'),
zlib: require.resolve('browserify-zlib'),
crypto: false,
domain: false,
path: false,
stream: false,
zlib: false,
},
// This allows you to set a fallback for where webpack should look for modules.
// We placed these paths second because we want `node_modules` to "win"
Expand Down

0 comments on commit 90e852d

Please sign in to comment.