Skip to content
This repository was archived by the owner on May 2, 2022. It is now read-only.
This repository was archived by the owner on May 2, 2022. It is now read-only.

SVGs are cropped upon deployment #130

@gthayer

Description

@gthayer

Describe the bug
When npm run build is run, SVGs have their "viewbox" attribute removed which causes cropping:

image

This is caused in plugin-scaffold/config/webpack.config.common.js. ImageminPlugin can be updated to this to correct it:

		// Compress images
		// Must happen after CopyWebpackPlugin
		new ImageminPlugin({
			disable: !isProduction,
			test: settings.ImageminPlugin.test,
			svgo: {
				plugins: [
					{
						removeViewBox: false,
					},
				],
			},
		}),

Steps to Reproduce

  1. If you site has SVGs, run npm run build to see the cropping
  2. npm run watch does not include the cropping because ImageminPlugin is disabled on non-production environments,.

Expected behavior
No cropping

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions