Preserve viewBox attribute in SVG sprite symbols

When generating the SVG sprite (using imagemin and svstore) the imagemin
step needs to NOT cleanup/remove the viewBox attributes from the
individual svg files.

fixes #1306
This commit is contained in:
Broc Seib 2019-10-01 17:24:57 -04:00
parent dfc09b8e04
commit 12e5099c92

View File

@ -222,7 +222,11 @@ Object.entries(build.sprite).forEach(([filename, entry]) => {
gulp
.src(src)
.pipe(plumber())
.pipe(imagemin())
.pipe(imagemin([
imagemin.svgo({
plugins: [{ removeViewBox: false }]
})
]))
.pipe(svgstore())
.pipe(rename({ basename: path.parse(filename).name }))
.pipe(size(sizeOptions))