-
-
Notifications
You must be signed in to change notification settings - Fork 413
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document plugins option? #919
Comments
To get vite + react + svgr + svgo working I needed to install // vite.config.ts
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import svgr from "vite-plugin-svgr";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
// https://github.com/pd4d10/vite-plugin-svgr#options
svgr({
svgrOptions: {
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"],
svgoConfig: {
// https://github.com/svg/svgo/blob/main/plugins/cleanupNumericValues.js#L32
floatPrecision: 2,
},
},
}),
],
}); I'm afraid I don't know how this translates to the other platforms svgr supports, like webpack. So I'm hesitant to do documentation pull requests. |
Some explanation of why they're needed would be great as well. At work we need to use |
This lack of docs tripped me up as well. |
馃悰 Bug Report
The
plugins
option is undocumented? It's not mentioned on:https://react-svgr.com/docs/options/
While it is needed to enable for example the svgo plugin:
https://www.npmjs.com/package/@svgr/plugin-svgo
Another place to possibly add a note about this requirement might be:
https://react-svgr.com/docs/options/#svgo
The text was updated successfully, but these errors were encountered: