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

fix: hardcoded sprite import #11

Merged
merged 1 commit into from
Jul 7, 2023
Merged

fix: hardcoded sprite import #11

merged 1 commit into from
Jul 7, 2023

Conversation

andrewcohen
Copy link
Contributor

Previously, the generated component would only be able to import the href if the outputPath ended in sprite.tsx, for example:

npx rmx-cli svg-sprite assets/icons app/components/icons/sprite.tsx

With this change, the sprite href import matches the filename correctly for outputPath with and without the filename declared i.e.

npx rmx-cli svg-sprite assets/icons app/components/icons/foo.tsx
npx rmx-cli svg-sprite assets/icons app/components/icons/

Previously, the generated component would only be able to import the `href` if the outputPath ended in `sprite.tsx`, for example:
```
npx rmx-cli svg-sprite assets/icons app/components/icons/sprite.tsx
```

With this change, the sprite href import matches the filename correctly for outputPath with and without the filename declared i.e
```
npx rmx-cli svg-sprite assets/icons app/components/icons/foo.tsx
npx rmx-cli svg-sprite assets/icons app/components/icons/
```
@andrewcohen andrewcohen changed the title fix hardcoded sprite import fix: hardcoded sprite import Jul 7, 2023
@kiliman kiliman merged commit d01dab7 into kiliman:main Jul 7, 2023
@kiliman
Copy link
Owner

kiliman commented Jul 7, 2023

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants