An SWC enabled solution for Inline SVGs #33161
Replies: 5 comments 11 replies
-
see #26167 |
Beta Was this translation helpful? Give feedback.
-
Using @svgr/webpack and the following config works without babel: config.module.rules.push({
test: /\.svg$/,
issuer: /\.tsx?$/,
include: [options.dir],
use: [
'next-swc-loader',
{
loader: '@svgr/webpack',
options: { babel: false }
}
],
}); In your component: import Image from './image.svg';
....
<Image /> In a skeleton app with one svg import I'm not seeing a performance hit to builds. Not sure how well it scales. |
Beta Was this translation helpful? Give feedback.
-
@fakundo @OscarBarrett @elliott-w it seems any of solution doesn't work with Any workaround to fix it? |
Beta Was this translation helpful? Give feedback.
-
has anyone figured out how to handle SVGR with Next.js v14 using SWC? I've tried every possible combination without any success so far |
Beta Was this translation helpful? Give feedback.
-
The year is 2025 and there isn't an inline SVG solution for NextJS. I'm really not shocked.Par for the corse for NextJS. No, I'm not just gonna pass it to next/image, and no I'm not gonna use a webpack config. It's 2025. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Turning this into a separate discussion from: #30174 (comment)
Seeing lots of upvotes, but I'm not sure it gets in front of people who could help.
Beta Was this translation helpful? Give feedback.
All reactions