From 810207faa2834c1ae2ea1013f54a2b5e5539afa8 Mon Sep 17 00:00:00 2001 From: ppc Date: Thu, 22 Aug 2024 09:20:10 +0100 Subject: [PATCH] use single exported file --- amnet-shared/package.json | 3 +++ amnet-shared/src/index.ts | 2 ++ amnet-shared/tsconfig.json | 3 ++- amnet-shared/tsup.config.ts | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 amnet-shared/src/index.ts diff --git a/amnet-shared/package.json b/amnet-shared/package.json index c1cd60b..e5a4e8e 100644 --- a/amnet-shared/package.json +++ b/amnet-shared/package.json @@ -12,6 +12,9 @@ "scripts": { "build": "tsup" }, + "exports": { + ".": "./dist/index.mjs" + }, "dependencies": { "tsup": "^8.2.4", "typescript": "^5.5.4" diff --git a/amnet-shared/src/index.ts b/amnet-shared/src/index.ts new file mode 100644 index 0000000..3fbd6f0 --- /dev/null +++ b/amnet-shared/src/index.ts @@ -0,0 +1,2 @@ +export * from './api'; +export * from './card'; \ No newline at end of file diff --git a/amnet-shared/tsconfig.json b/amnet-shared/tsconfig.json index 59815c3..d543ba3 100644 --- a/amnet-shared/tsconfig.json +++ b/amnet-shared/tsconfig.json @@ -7,7 +7,8 @@ "forceConsistentCasingInFileNames": true, "strict": true, "noUncheckedIndexedAccess": true, - "skipLibCheck": true + "skipLibCheck": true, + "baseUrl": "." }, "include": ["src/**/*.ts"] } diff --git a/amnet-shared/tsup.config.ts b/amnet-shared/tsup.config.ts index c49e194..4f62e04 100644 --- a/amnet-shared/tsup.config.ts +++ b/amnet-shared/tsup.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from "tsup"; export default defineConfig({ - entry: ["src/amnet-api.ts", "src/cardgen.ts"], + entry: ["src/index.ts"], format: ["cjs", "esm"], splitting: false, sourcemap: true,