1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-12 06:41:40 +03:00

26 Commits

Author SHA1 Message Date
cb3eea80ba fix(#2140): SVGO fails with ERR_UNSUPPORTED_ESM_URL_SCHEME on Windows (#2141) 2025-06-09 22:18:29 +01:00
eabc29d159 fix: types for loadConfig and add more tests (#2123) 2025-05-06 08:05:09 +01:00
52c09479e9 fix: fix loadConfig types (#2122) 2025-05-06 07:13:05 +01:00
747cc722d9 chore: revamp how we export types (#2118) 2025-05-04 17:39:44 +01:00
a8a53dbd90 chore: apply more eslint rules (#2116) 2025-05-02 10:00:37 +01:00
9eb3af59f2 chore: drop parentNode property (#2113) 2025-05-01 15:59:23 +01:00
df87725b19 chore: improve jsdoc types and match most files (#2108) 2025-04-29 10:35:11 +01:00
71a1254895 fix: improve jsdoc types and remove excludes (#2107) 2025-04-28 22:24:16 +01:00
97d7d00add add: centralize exports to svgo (#2071) 2024-09-07 19:26:05 +01:00
0c13740fdd feat: expose builtin plugins (#2027) 2024-06-09 12:28:37 +01:00
35d3fb6ee8 chore: export default and named packages (#2022) 2024-06-07 18:08:05 +01:00
78403d3dc9 feat: export version constant (#2016) 2024-05-27 20:28:13 +01:00
4daaa4251f chore: update ESLint to v9 and switch to flat config (#2001) 2024-05-26 13:22:23 +01:00
2442f74239 chore: convert project to us ECMAScript modules (preserving CJS compatibility) (#1905) 2024-01-03 16:17:37 +00:00
d5a8555781 Drop node 10 require fallback when load config 2022-10-02 12:15:41 +03:00
516c6e1fc1 Drop createContentItem from public api and JSAPI node wrappers 2022-10-02 12:00:44 +03:00
bb590b8928 Drop extendDefaultPlugins 2022-10-02 00:17:16 +03:00
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
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
1b56e70cc0 Fix config type (#1573) 2021-09-15 22:55:19 +03:00
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
71e47370bd Format lib with prettier (#1386)
Note: review with hidden whitespaces
2021-02-28 10:56:16 +03:00
a855b40ec5 Fail when specified config is wrong or json is specified 2021-02-22 23:50:42 +03:00
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
330e78b479 Fix reporting of config errors (#1342)
Errors are swallowed while resolving.
2021-02-19 12:11:35 +03:00
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