Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 7d83ae9

Browse files
authored
fix(imports): define additional entry points for compatibility (#26)
Co-authored-by: Jan Soukup <[email protected]>
1 parent 8ed0697 commit 7d83ae9

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Diff for: package.json

+4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
"license": "MIT",
1010
"author": "Jan Soukup <[email protected]>",
1111
"exports": {
12+
"default": "./dist/main.js",
13+
"require": "./dist/main.js",
14+
"import": "./dist/main.mjs",
1215
"server-handler": "./dist/server-handler.js",
1316
"server-handler/zip": "./dist/server-handler.zip",
1417
"image-handler": "./dist/image-handler.js",
1518
"image-handler/zip": "./dist/image-handler.zip",
1619
"sharp-layer/zip": "./dist/sharp-layer.zip"
1720
},
1821
"main": "dist/main.js",
22+
"module": "dist/main.mjs",
1923
"types": "dist/main.d.ts",
2024
"bin": {
2125
"app": "dist/cli.js"

Diff for: rollup.config.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ export default [
77
{
88
input: 'lib/index.ts',
99
plugins: [json(), ts()],
10-
output: {
11-
format: 'cjs',
12-
file: pkg.main,
13-
},
10+
output: [
11+
{
12+
format: 'cjs',
13+
file: pkg.main,
14+
},
15+
{
16+
format: 'esm',
17+
file: pkg.module,
18+
},
19+
],
1420
},
1521
{
1622
input: 'lib/cli.ts',

0 commit comments

Comments
 (0)