Closed st-schneider closed 4 years ago
Sorry for delay. What you did actually should have worked. Can you provide more details. Full config and folder structure maybe?
the curly braces in glob notation should expand before evaluating the path. So I expected {one,two}/sprites/*.png
to be a set of one/sprites/*.png
and two/sprites/*.png
.
I have some kind of common folder for images where a legacy part and a modern part grab the common images so I need at least two folder for a spritesheet.
Well yes, I just tried it on my machine and it worked fine.
Actually on dev/config.js
that I use to test things, there is glob that looks like **/ico/*.png
. I replaced it with {close,send}/ico/*.png
and it worked as well. I think we are missing something there.
Or do you expect it to generate two spritesheets? In that case just make two instances of a plugin. Maybe along with some helper that creates them to avoid too much duplication.
no I expect one spritesheet with content of folder one and two
Sorry, I totally forgot about this issue.
Is this still a problem? Glob you are mentioning should just work.
Maybe your folders are containing icons with common names, Then some icons may become inaccessible. If that is the case either rename them or use config.api.generateSpriteName
, or use custom template.
I haven't tried in a while. I will inform you when i do
there and back again. seems to be still an issue :P
I need more details then) mcve if possible.
As it seems cwd does not support the {} syntax but glob does, so I added it there :P
./src/Resources/themes/base/sprite/logo.png
./src/Resources/themes/xmas/sprite/xmas-logo.png
this does not work
new SpritesmithPlugin({
src: {
cwd: './src/Resources/themes/{base,xmas}/sprite'),
glob: '*.png',
},
this does work
new SpritesmithPlugin({
src: {
cwd: './src/Resources/themes'),
glob: '{base,xmas}/sprite/*.png',
},
Well that is expected. I just couldn't figure out the problem from what you were saying before) Closing it now.
I tried to get pngs together from multiple files with the glob pattern like
{one,two}/sprites/*.png
, but the path is resolved without expanding the{one,two}
into seperate sets. Would it be possible to either have an array of cwds or some better glob resolution?