Skip to content

Commit

Permalink
fix(imports): define additional entry points for compatibility (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Soukup <soukup@u.plus>
  • Loading branch information
sladg and sladg authored Sep 1, 2022
1 parent 8ed0697 commit 7d83ae9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@
"license": "MIT",
"author": "Jan Soukup <jan@ssoukup.com>",
"exports": {
"default": "./dist/main.js",
"require": "./dist/main.js",
"import": "./dist/main.mjs",
"server-handler": "./dist/server-handler.js",
"server-handler/zip": "./dist/server-handler.zip",
"image-handler": "./dist/image-handler.js",
"image-handler/zip": "./dist/image-handler.zip",
"sharp-layer/zip": "./dist/sharp-layer.zip"
},
"main": "dist/main.js",
"module": "dist/main.mjs",
"types": "dist/main.d.ts",
"bin": {
"app": "dist/cli.js"
Expand Down
14 changes: 10 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ export default [
{
input: 'lib/index.ts',
plugins: [json(), ts()],
output: {
format: 'cjs',
file: pkg.main,
},
output: [
{
format: 'cjs',
file: pkg.main,
},
{
format: 'esm',
file: pkg.module,
},
],
},
{
input: 'lib/cli.ts',
Expand Down

0 comments on commit 7d83ae9

Please sign in to comment.