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

18 Commits

Author SHA1 Message Date
Seth Falco
97d7d00add
add: centralize exports to svgo (#2071) 2024-09-07 19:26:05 +01:00
Seth Falco
0c13740fdd
feat: expose builtin plugins (#2027) 2024-06-09 12:28:37 +01:00
Seth Falco
35d3fb6ee8
chore: export default and named packages (#2022) 2024-06-07 18:08:05 +01:00
Seth Falco
78403d3dc9
feat: export version constant (#2016) 2024-05-27 20:28:13 +01:00
XhmikosR
4daaa4251f
chore: update ESLint to v9 and switch to flat config (#2001) 2024-05-26 13:22:23 +01:00
Jon Dufresne
2442f74239
chore: convert project to us ECMAScript modules (preserving CJS compatibility) (#1905) 2024-01-03 16:17:37 +00:00
Bogdan Chadkin
d5a8555781 Drop node 10 require fallback when load config 2022-10-02 12:15:41 +03:00
Bogdan Chadkin
516c6e1fc1 Drop createContentItem from public api and JSAPI node wrappers 2022-10-02 12:00:44 +03:00
Bogdan Chadkin
bb590b8928 Drop extendDefaultPlugins 2022-10-02 00:17:16 +03:00
Bogdan Chadkin
c7995035ef
Load .cjs with require only (#1605)
Ref https://github.com/svg/svgo/issues/1596

At the moment dynamic import may randomly fail with segfault.
To workaround this for some users .cjs extension is loaded
exclusively with require.
2021-10-30 01:31:36 +03:00
Bogdan Chadkin
7111c52f96
Support es modules (#1583)
Ref https://github.com/svg/svgo/issues/1579

In config of course. Projects with type:module can now use modules to
export config

```js
export default {
  plugins: []
}
```

Also added support for resolving svgo.config.mjs and svgo.config.cjs.

Moved loadConfig tests to svgo-node tests.

mjs test is skipped for now in node 10, just don't use modules there
2021-09-23 21:44:55 +03:00
Chris Wilkinson
1b56e70cc0
Fix config type (#1573) 2021-09-15 22:55:19 +03:00
Bogdan Chadkin
23c7f48130
Move platform specific eol to svgo-node entry point (#1565)
`os` package in js2svg module bothered me for a long time.
We had to hack rollup to mock it for browser.

Thanks to https://github.com/svg/svgo/pull/1546 we now can pass eol from
svgo-node entry point and simplify build.
2021-09-12 16:40:21 +03:00
Bogdan Chadkin
71e47370bd
Format lib with prettier (#1386)
Note: review with hidden whitespaces
2021-02-28 10:56:16 +03:00
Bogdan Chadkin
a855b40ec5 Fail when specified config is wrong or json is specified 2021-02-22 23:50:42 +03:00
Bogdan Chadkin
a7cc20bb43
Setup recommended eslint preset (#1345)
This is usually enough to prevent silly mistakes.
Formatting will be done by prettier after merging pull requests.
2021-02-19 15:26:07 +03:00
Bogdan Chadkin
330e78b479
Fix reporting of config errors (#1342)
Errors are swallowed while resolving.
2021-02-19 12:11:35 +03:00
Bogdan Chadkin
a6f14018ee
Implement loadConfig utility (#1328)
Ref https://github.com/svg/svgo/issues/1327

Config file now can only be js. `svgo.config.js` is searched by default.
Otherwise any js module specified in `--config` cli flag.

Config loader is exposed in entry point as `loadConfig(configFile, cwd)`.
2021-02-16 19:11:13 +03:00