Skip to content

Commit 21fb484

Browse files
committed
build(openapi-fetch): bundle commonjs
1 parent 5fc8111 commit 21fb484

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/openapi-fetch/package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@
99
"license": "MIT",
1010
"type": "module",
1111
"main": "./dist/index.js",
12+
"module": "./dist/index.js",
13+
"types": "./dist/index.d.ts",
14+
"exports": {
15+
".": {
16+
"require": "./dist/index.cjs",
17+
"import": "./dist/index.js",
18+
"types": "./dist/index.d.ts"
19+
}
20+
},
1221
"homepage": "https://openapi-ts.pages.dev",
1322
"repository": {
1423
"type": "git",
@@ -32,10 +41,11 @@
3241
"svelte"
3342
],
3443
"scripts": {
35-
"build": "pnpm run build:clean && pnpm run build:ts && pnpm run build:ts-min",
44+
"build": "pnpm run build:clean && pnpm run build:ts && pnpm run build:ts-min && pnpm run build:cjs",
3645
"build:clean": "del dist",
3746
"build:ts": "tsc -p tsconfig.build.json",
3847
"build:ts-min": "esbuild --bundle src/index.ts --format=esm --minify --outfile=dist/index.min.js && cp dist/index.d.ts dist/index.min.d.ts",
48+
"build:cjs": "esbuild --bundle src/index.ts --format=cjs --outfile=dist/index.cjs",
3949
"lint": "pnpm run lint:js",
4050
"lint:js": "prettier --check \"{src,test}/**/*\"",
4151
"test": "pnpm run test:ts && npm run test:js",

0 commit comments

Comments
 (0)