Skip to content

Commit

Permalink
STRWEB-4 add crypto-browserify depenency to polyfill crypto in axe te…
Browse files Browse the repository at this point in the history
…st runs (#37)

`webpack` `v5` removed many polyfills that were present in `v4`. 
This PR restores one of them, resolving this error message:
```
message: "Module not found: Error: Can't resolve 'crypto' in '/Users/zburke/projects/folio-org/stripes-components/node_modules/axe-core'\n"
```

Refs STRWEB-4
  • Loading branch information
JohnC-80 authored Nov 5, 2021
1 parent 56640fe commit ec148a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"commander": "^2.9.0",
"connect-history-api-fallback": "^1.3.0",
"core-js": "^3.6.1",
"crypto-browserify": "^3.12.0",
"css-loader": "^6.4.0",
"css-minimizer-webpack-plugin": "3.1.1",
"csv-loader": "^3.0.3",
Expand Down
1 change: 1 addition & 0 deletions webpack.config.cli.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ devConfig.plugins.push(

// add resolutions for node utilities required for test suites.
devConfig.resolve.fallback = {
"crypto": require.resolve('crypto-browserify'),
"stream": require.resolve('stream-browserify'),
"util": require.resolve('util-ex'),
};
Expand Down

0 comments on commit ec148a4

Please sign in to comment.