Skip to content

Disabling SVGO via the svgo option in config file doesn't seem to work with CLI #837

@mryechkin

Description

@mryechkin

🐛 Bug Report

Disabling SVGO by setting svgo: false in svgr.config.js doesn't seem to work when using the CLI.

In order to truly disable it, I have to run it with the --no-svgo flag:

svgr --no-svgo --out-dir src/icons -- assets/svg

To Reproduce

Specify the following in svgr.config.js:

module.exports = {
  icon: true,
  ref: true,
  titleProp: true,
  svgo: false,
};

Then run the CLI:

svgr --out-dir src/icons -- assets/svg

Expected behavior

SVGO optimizations should not be run.

System Info

## System:
 - OS: macOS 13.2.1
 - CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
 - Memory: 85.88 MB / 16.00 GB
 - Shell: 5.8.1 - /bin/zsh
## Binaries:
 - Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
 - npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
## npmPackages:
 - @svgr/cli: ^6.5.1 => 6.5.1 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions