1
0
mirror of https://github.com/svg/svgo.git synced 2025-04-19 10:22:15 +03:00

12 Commits

Author SHA1 Message Date
Bogdan Chadkin
a228020329
Refactor defs plugins (#1544)
Refactored and covered with types following plugins

- removeUselessDefs
- sortDefsChildren
2021-08-25 20:52:07 +03:00
Bogdan Chadkin
07f8d606e0
Implement preset-default plugin (#1513)
I saw complaints about `extendDefaultPlugins` api

- it cannot be used when svgo is installed globally
- it requires svgo to be installed when using svgo-loader or svgo-jsx
- it prevents using serializable config formats like json

In this diff I introduced the new plugin which is a bundle of all
default plugins.

```js
module.exports = {
  plugins: [
    'preset_default',
    // or
    {
      name: 'preset_default',
      floatPrecision: 4,
      overrides: {
        convertPathData: {
          applyTransforms: false
        }
      }
    }
  ]
}
```
2021-08-13 19:07:08 +03:00
Bogdan Chadkin
316a002299
Remove hasAttr and hasAttrLocal usages (#1447)
In most cases simple check for null is enough.
2021-03-22 01:24:59 +03:00
Bogdan Chadkin
5314c12c99 Convert element children to xast
Ref https://github.com/syntax-tree/xast

Renamed content to children to match xast spec.
2021-03-11 12:29:13 +03:00
Bogdan Chadkin
00ec0f71fe Format all plugins with prettier 2021-03-09 19:58:00 +03:00
caub
5c2a9160fc clean .reduce with side-effects 2017-04-02 17:00:34 +02:00
GreLI
a7f62d8984 Formatting 2015-06-21 19:13:41 +03:00
Yoshiya Hinosawa
3f8e6fd15c Fix lint 2015-06-12 00:25:32 +09:00
Yoshiya Hinosawa
8e6b365c40 Add --show-plugins option 2015-06-07 19:35:49 +09:00
Ville Väänänen
efe447a117 Don't remove styles in removeUselessDefs.js 2015-04-29 14:26:42 +03:00
GreLI
1121582564 Remove non-rendering elements without ids as well 2015-03-29 14:56:38 +03:00
GreLI
c47fa38700 Plugin to remove elements in <defs> without id. Resolves #310 2015-03-29 00:30:51 +03:00