diff --git a/package.json b/package.json index 278812ce..5b85ae94 100644 --- a/package.json +++ b/package.json @@ -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" ], diff --git a/rslib.config.ts b/rslib.config.ts index 7d67e0f4..c705bd12 100644 --- a/rslib.config.ts +++ b/rslib.config.ts @@ -23,6 +23,11 @@ export default defineConfig({ format: "esm", syntax: "es2022", dts: true, + output: { + distPath: { + root: "./dist/esm/", + }, + }, }, { format: "cjs", @@ -30,6 +35,20 @@ export default defineConfig({ // 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,