Skip to content
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

SVGR Options & TypeScript #5

Closed
mfpopa opened this issue May 28, 2021 · 4 comments
Closed

SVGR Options & TypeScript #5

mfpopa opened this issue May 28, 2021 · 4 comments

Comments

@mfpopa
Copy link

mfpopa commented May 28, 2021

@pd4d10 Thanks for creating the plugin. Works nicely and I like that I can use both the default export for the src/path of the svg and the named export for the React component.

I was wondering if you would accept a PR to enable the plugin users to pass SVGR options (e.g. { plugins: ['@svgr/plugin-svgo'] }).

Also, I think the plugin should provide the typings to support this change to svg file imports. A simple client.d.ts with the typings suggested in #3 which is then added by the users to the tsconfig.json like "types": ["vite/client", "vite-plugin-svgr/client"] would be a solution.

@pd4d10
Copy link
Owner

pd4d10 commented Jun 12, 2021

I was wondering if you would accept a PR to enable the plugin users to pass SVGR options (e.g. { plugins: ['@svgr/plugin-svgo'] }).

Sure. PR's welcome!

@pd4d10
Copy link
Owner

pd4d10 commented Jun 13, 2021

BTW, plugins like svgo are more suitable for use in production mode.

Perhaps we can make it built-in and decide when to use it by https://vitejs.dev/config/#conditional-config

@IanVS
Copy link
Contributor

IanVS commented Aug 17, 2021

It looks like there are two PRs open to add svgr options: #11 and #13.

@pd4d10
Copy link
Owner

pd4d10 commented Nov 13, 2021

Fixed in v0.6.0. Thanks for @IanVS 's work!

@pd4d10 pd4d10 closed this as completed Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants