通过 config-overrides.js 添加 webpack 插件
我正在使用带有自定义配置的 React 应用程序,无需弹出,为此我正在使用 React-app-rewire。为了向 webpack 提供插件,我使用了react-app-rewire-provide-plugin。将我的反应脚本更新到最新版本后,反应应用程序重新布线提供插件不支持。因此我需要找到一种方法将插件添加到我的 webpack 配置中。有什么解决办法吗? 提前致谢
I'm using react app with customized configuration without ejecting and for that I'm using react-app-rewire. To provide plugins to webpack, I used react-app-rewire-provide-plugin. After updating my react-scripts to the latest version the react-app-rewire-provide-plugin is not supporting. Therefore I need to find a method to add plugins to my webpack configuration. Any solutions?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
真实示例: https://github.com/criszz77/luna/blob/ccaac73f82574fb409b69843e260dd58a3f68f8c/template/config-overrides.js
我一直在使用react-app-rewired和customize-cra将插件传递给webpack 无需弹出。
你在这里看到的是一个用react-app-rewired替换craco的PR(显然它现在可以在react-scripts@5中使用)
Real example: https://github.com/criszz77/luna/blob/ccaac73f82574fb409b69843e260dd58a3f68f8c/template/config-overrides.js
I’ve been using react-app-rewired along with customize-cra to pass plugins to the webpack without ejecting.
What you’re seeing here is a PR to replace craco with react-app-rewired (apparently it works wirh react-scripts@5 now)