Skip to content

Commit

Permalink
add UMD bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
binarykitchen committed Dec 12, 2024
1 parent a397c53 commit 5effa44
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.cjs",
"umd": "./dist/umd/index.js"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"files": [
"dist"
],
Expand Down
19 changes: 19 additions & 0 deletions rslib.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,32 @@ export default defineConfig({
format: "esm",
syntax: "es2022",
dts: true,
output: {
distPath: {
root: "./dist/esm/",
},
},
},
{
format: "cjs",
// This will include all the JS code into one single file without
// the use of require()
autoExternal: false,
syntax: "es2015",
output: {
distPath: {
root: "./dist/cjs/",
},
},
},
{
format: "umd",
umdName: "VideomailClient",
output: {
distPath: {
root: "./dist/umd/",
},
},
},
],
mode: isProductionMode() ? NodeEnvType.PRODUCTION : NodeEnvType.DEVELOPMENT,
Expand Down

0 comments on commit 5effa44

Please sign in to comment.