1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-28 09:22:00 +03:00

chore: export default and named packages (#2022)

This commit is contained in:
Seth Falco
2024-06-07 18:08:05 +01:00
committed by GitHub
parent 1e23f66e76
commit 35d3fb6ee8
6 changed files with 16 additions and 4 deletions

4
lib/svgo-node.d.ts vendored
View File

@ -1,6 +1,6 @@
import { Config, optimize } from './svgo'; import { VERSION, Config, optimize } from './svgo';
export { optimize }; export { VERSION, optimize };
/** /**
* If you write a tool on top of svgo you might need a way to load svgo config. * If you write a tool on top of svgo you might need a way to load svgo config.

View File

@ -74,3 +74,9 @@ export const optimize = (input, config) => {
}, },
}); });
}; };
export default {
VERSION,
loadConfig,
optimize,
};

View File

@ -100,3 +100,8 @@ export const optimize = (input, config) => {
data: output, data: output,
}; };
}; };
export default {
VERSION,
optimize,
};

View File

@ -1,2 +1,2 @@
/** Version of SVGO. */ /** Version of SVGO. */
export const VERSION = '4.0.0'; export const VERSION = '4.0.0-rc.0';

View File

@ -1,7 +1,7 @@
{ {
"packageManager": "yarn@3.8.2", "packageManager": "yarn@3.8.2",
"name": "svgo", "name": "svgo",
"version": "4.0.0", "version": "4.0.0-rc.0",
"description": "SVGO is a Node.js library and command-line application for optimizing vector images.", "description": "SVGO is a Node.js library and command-line application for optimizing vector images.",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",

View File

@ -39,6 +39,7 @@ export default [
output: { output: {
file: './dist/svgo-node.cjs', file: './dist/svgo-node.cjs',
format: 'cjs', format: 'cjs',
exports: 'named',
}, },
external: ['os', 'fs', 'url', 'path', ...Object.keys(PKG.dependencies)], external: ['os', 'fs', 'url', 'path', ...Object.keys(PKG.dependencies)],
onwarn(warning) { onwarn(warning) {