We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
filePath
SPRITES_META
Hi! I tried to follow the instructions here https://neodx.pages.dev/svg/group-and-hash.html to add a hash to the sprite file name and then use its name with hash in my Icon component (filePath), but I ran into trouble with the fact that SPRITES_META did not include filePath. After some searching I realized that to generate filePath you need to specify either size or viewBox in the metadata.runtime (https://github.com/secundant/neodx/blob/main/libs/svg/src/plugins/metadata.ts#L66-L91).
Icon
size
viewBox
metadata.runtime
Maybe it should be included in the official documentation in the second step at https://neodx.pages.dev/svg/group-and-hash.html
Below are the configs that generate sprites containing hashes in their names but with and without the filePath key in SPRITES_META
SPRITES_META does not include the filePath:
svg({ root: 'src/assets', output: 'public/sprites', fileName: '{name}.{hash:8}.svg', metadata: { path: 'src/shared/ui/components/icon/sprite.gen.ts', }, resetColors: { replaceUnknown: 'currentColor', }, }),
SPRITES_META includes the filePath:
svg({ root: 'src/assets', output: 'public/sprites', fileName: '{name}.{hash:8}.svg', metadata: { path: 'src/shared/ui/components/icon/sprite.gen.ts', runtime: { size: true } }, resetColors: { replaceUnknown: 'currentColor', }, }),
And thanks for your project!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi! I tried to follow the instructions here https://neodx.pages.dev/svg/group-and-hash.html to add a hash to the sprite file name and then use its name with hash in my
Icon
component (filePath
), but I ran into trouble with the fact thatSPRITES_META
did not includefilePath
. After some searching I realized that to generatefilePath
you need to specify eithersize
orviewBox
in themetadata.runtime
(https://github.com/secundant/neodx/blob/main/libs/svg/src/plugins/metadata.ts#L66-L91).Maybe it should be included in the official documentation in the second step at https://neodx.pages.dev/svg/group-and-hash.html
Below are the configs that generate sprites containing hashes in their names but with and without the
filePath
key inSPRITES_META
SPRITES_META
does not include thefilePath
:SPRITES_META
includes thefilePath
:And thanks for your project!
The text was updated successfully, but these errors were encountered: