【发布时间】:2021-07-23 18:54:27
【问题描述】:
我想将 use-shopping-cart (https://useshoppingcart.com/) 添加到我的 Gatsby 项目中。 当我尝试使用它时,我得到了这个错误:
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules
by default.
This is no longer the case. Verify if you need this module and configure a
polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto":
require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }
如何将crypto-browserify 添加到 gatsby?作为gatsby-config.js内的插件?
谢谢!
【问题讨论】:
标签: javascript reactjs webpack stripe-payments gatsby