svgr
svgr copied to clipboard
How I can use svgr with rollup with query parameters for import
Hello! With webpack I can use imports for svg as https://react-svgr.com/docs/webpack/#use-svgr-and-asset-svg-in-the-same-project How I can use query params for import with rollup for svg imports?
Just got this issue too. I write a plugin to solve my problem rollup-plugin-resource-query.
import url from '@rollup/plugin-url'
import svgr from '@svgr/rollup'
import resourceQuery from 'rollup-plugin-resouce-query'
export default {
plugins: [resourceQuery({ resourceQuery: 'url' }), url(), svgr()],
input: 'src/main.js',
output: {
file: 'bundle.js',
format: 'cjs',
},
}
It solve issue in my project at least. hope someone came across this post can benefit from it. 😄
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.