To embed the contents of an SVG file into your site using NextJS 12 with the new Rust-based compiler, perform the following steps:
- Install
@svg/webpack
:
$ npm install --save-dev @svgr/webpack
- Create a
svgr.config.js
config file with the following contents. This will remove the width and height from the SVG but keep the viewBox for correct scaling.