Skip to content

Commit 35d3fb6

Browse files
authored
chore: export default and named packages (svg#2022)
1 parent 1e23f66 commit 35d3fb6

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

lib/svgo-node.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Config, optimize } from './svgo';
1+
import { VERSION, Config, optimize } from './svgo';
22

3-
export { optimize };
3+
export { VERSION, optimize };
44

55
/**
66
* If you write a tool on top of svgo you might need a way to load svgo config.

lib/svgo-node.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,9 @@ export const optimize = (input, config) => {
7474
},
7575
});
7676
};
77+
78+
export default {
79+
VERSION,
80+
loadConfig,
81+
optimize,
82+
};

lib/svgo.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,8 @@ export const optimize = (input, config) => {
100100
data: output,
101101
};
102102
};
103+
104+
export default {
105+
VERSION,
106+
optimize,
107+
};

lib/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/** Version of SVGO. */
2-
export const VERSION = '4.0.0';
2+
export const VERSION = '4.0.0-rc.0';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"packageManager": "[email protected]",
33
"name": "svgo",
4-
"version": "4.0.0",
4+
"version": "4.0.0-rc.0",
55
"description": "SVGO is a Node.js library and command-line application for optimizing vector images.",
66
"license": "MIT",
77
"type": "module",

rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default [
3939
output: {
4040
file: './dist/svgo-node.cjs',
4141
format: 'cjs',
42+
exports: 'named',
4243
},
4344
external: ['os', 'fs', 'url', 'path', ...Object.keys(PKG.dependencies)],
4445
onwarn(warning) {

0 commit comments

Comments
 (0)