-
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
fix(webpack): bring back previous SVG and SVGR behavior for React projects #22628
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 517ecb8. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
4e45b19
to
ded0403
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
The removal of
file-loader
from React's webpack configuration caused a breaking change where importingdefault
like so:Results in a React component via SVGR rather than a proper asset. There is no way to make asset modules from Webpack 5 work with the existing behavior, so we should introduce the new behavior later in Nx 20 as a breaking change + a migration.
Current Behavior
SVG default export is always a React component.
Expected Behavior
SVG assets should work for React projects.
Related Issue(s)
Fixes #21773