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

No filePath info provided to template file #35

Closed
andyrichardson opened this issue May 12, 2022 · 1 comment
Closed

No filePath info provided to template file #35

andyrichardson opened this issue May 12, 2022 · 1 comment

Comments

@andyrichardson
Copy link

Hi there, thanks for putting this together!

I'm working with a template that has some conditional logic depending on where the SVG is sourced.

// Example
if (context.options.state.filePath.includes("glyphs/")) {
// ...

This works totally fine when using @svgr/cli

npx @svgr/cli --template template.js -- src/glyphs/plus.svg

However, when using this plugin, the filePath attribute is no longer available.

console.log(context.options.state)
// { componentName: 'ReactComponent' }
@andyrichardson andyrichardson changed the title No filename info provided to template file No filePath info provided to template file May 12, 2022
@andyrichardson
Copy link
Author

Looks like it has been added since 👍

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

1 participant