Skip to content

Commit e615269

Browse files
kecrilydrwpow
andauthored
build(openapi-fetch): bundle commonjs (#1176)
* build(openapi-fetch): bundle commonjs * Update packages/openapi-fetch/package.json Co-authored-by: Drew Powers <[email protected]> --------- Co-authored-by: Drew Powers <[email protected]>
1 parent 5fc8111 commit e615269

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/openapi-fetch/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
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+
"*": "./*"
21+
},
1222
"homepage": "https://openapi-ts.pages.dev",
1323
"repository": {
1424
"type": "git",
@@ -32,10 +42,11 @@
3242
"svelte"
3343
],
3444
"scripts": {
35-
"build": "pnpm run build:clean && pnpm run build:ts && pnpm run build:ts-min",
45+
"build": "pnpm run build:clean && pnpm run build:ts && pnpm run build:ts-min && pnpm run build:cjs",
3646
"build:clean": "del dist",
3747
"build:ts": "tsc -p tsconfig.build.json",
3848
"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",
49+
"build:cjs": "esbuild --bundle src/index.ts --format=cjs --outfile=dist/index.cjs",
3950
"lint": "pnpm run lint:js",
4051
"lint:js": "prettier --check \"{src,test}/**/*\"",
4152
"test": "pnpm run test:ts && npm run test:js",

0 commit comments

Comments
 (0)