From 9a6db89939084c5ba0b750cf0e868e5599c6fba1 Mon Sep 17 00:00:00 2001 From: Simon Hofer Date: Thu, 7 May 2026 16:15:53 +0200 Subject: [PATCH] fix: add cjs entry point and enforce named exports --- package.json | 4 +++- src/bundle.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 45eb694..cabdf7b 100644 --- a/package.json +++ b/package.json @@ -28,12 +28,14 @@ "npm": ">=11" }, "types": "./sdk/dist/index.d.ts", + "main": "./sdk/dist/index.cjs", "module": "./sdk/dist/index.js", "type": "module", "exports": { ".": { "types": "./sdk/dist/index.d.ts", - "import": "./sdk/dist/index.js" + "import": "./sdk/dist/index.js", + "require": "./sdk/dist/index.cjs" } }, "scripts": { diff --git a/src/bundle.ts b/src/bundle.ts index 547f1a8..3dbbdbf 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -24,6 +24,7 @@ const emitDeclarations = (tsconfigPath: string, outDir: string) => { const generateOutput = (config: OutputOptions): OutputOptions => ({ sourcemap: false, banner: `/* weclapp sdk */`, + exports: 'named', ...config });