Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Oct 20, 2023
1 parent 8be51d9 commit 018ae38
Show file tree
Hide file tree
Showing 3 changed files with 373 additions and 5 deletions.
10 changes: 9 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const path = require('path')
/**
* Customise webpack config.
*/
exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => {
exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions, getConfig }) => {
if (stage === 'build-html' || stage === 'develop-html') {
actions.setWebpackConfig({
module: {
Expand Down Expand Up @@ -47,4 +47,12 @@ exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) =>
},
},
})

actions.setWebpackConfig({
resolve: {
fallback: {
crypto: require.resolve('crypto-browserify'),
},
},
})
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"babel-plugin-transform-remove-console": "^6.9.4",
"clsx": "^2.0.0",
"crunker": "^2.1.0",
"crypto-browserify": "^3.12.0",
"dayjs": "^1.11.10",
"gatsby": "^5.12.8",
"gatsby-plugin-image": "^3.12.2",
Expand Down
Loading

0 comments on commit 018ae38

Please sign in to comment.