the @2x group will be generated many times when used with postcss-cli, so the generated file path is something like sprite.@2x.@2x.@2x.......@2x.@2x.@2x.group.png.
Haven't look into the code carefully.
Currently, I just provide a onSaveSpritesheet hook to filter the unnecessary @2x group.
onSaveSpritesheet (opts, groups = []) {
groups = groups.filter((item, index) => {
return groups.indexOf(item) === index
})
// the following line of code is copied from method `makeSpritesheetPath` of the source code
// which is the default function to generate file path if no onSaveSpritesheet is provided.
return path.join(opts.spritePath, ['sprite', ...groups, 'png'].join('.'))
},
the
@2x
group will be generated many times when used with postcss-cli, so the generated file path is something likesprite.@2x.@2x.@2x.......@2x.@2x.@2x.group.png
.Haven't look into the code carefully.
Currently, I just provide a onSaveSpritesheet hook to filter the unnecessary
@2x
group.