-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack 5 support #1584
Comments
Added back node polyfills until redoc supports Webpack 5: Redocly/redoc#1584 Closes #25 #37
Added back node polyfills until redoc supports Webpack 5: Redocly/redoc#1584 Closes #25 #37
This is what you'll need to add to webpack config to fix build for webpack 5 or for use with latest docusaurus beta: import webpack from 'webpack';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
const webpackConfig = {
resolve: {
fallback: {
fs: false,
},
},
plugins: [
new webpack.DefinePlugin({
"process.versions.node": JSON.stringify(process.versions.node || "0.0.0"),
}),
new NodePolyfillPlugin(),
],
}; If more errors pop up then this article was really helpful for debugging: |
I ran into this trouble when I attempted to upgrade my Docusaurus installation to the beta version, which internally updates its webpack to v5. |
@pglezen Off topic but I have made a redoc preset for docusaurus, might be useful to you: https://github.com/rohit-gohri/redocusaurus |
If I understand correctly, the beta version is unusable because it switches to webpack5 (which is not supported)? Is there a way to constrain the webpack version as an end-user? |
Tried the solution proposed by @rohit-gohri , unfortunately did not work for me with "webpack": "5.62.1" , still getting :
|
Updated my answer above to add this:
to fix this error. |
I'm sorry for being dense. But where does one find/create a |
I think that requires creating a plugin. You might be interested in https://github.com/rohit-gohri/redocusaurus for a prebuilt solution for adding redoc to Docusaurus. Or if you want to do it yourself, then this gist gives an example: https://gist.github.com/rohit-gohri/59d0e6a9b4f51d1dd39f5e8894050f74 |
Confirmed this works for Redoc + Gatsby as well. |
Hi will there be any Webpack 5 support anytime soon?
The text was updated successfully, but these errors were encountered: