Resolving core modules in webpack 5 #11782
Answered
by
wisammechano
wisammechano
asked this question in
Q&A
-
I've just updated one of my projects to new CRA v 5.0.0, and I am facing the issue with stream polyfill since webpack 5 is not automatically pulling the polyfill. Is there an approach in providing the fallback module somewhere without ejecting? |
Beta Was this translation helpful? Give feedback.
Answered by
wisammechano
Dec 16, 2021
Replies: 2 comments 1 reply
-
Found the solution here. You have to use craco to extend webpack config. // craco.config.js
module.exports = {
webpack: {
configure: {
resolve: {
fallback: {
path: require.resolve("path-browserify"),
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
},
},
},
},
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
wisammechano
-
So, anyone with a solution? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found the solution here. You have to use craco to extend webpack config.