diff --git a/jsr.json b/jsr.json index 7007260..524afe9 100644 --- a/jsr.json +++ b/jsr.json @@ -3,13 +3,13 @@ "name": "@sftsrv/synk", "version": "0.0.3", "exports": { - ".": "./dist/index.js", - "./in-memory": "./dist/in-memory/index.js", - "./async": "./dist/async/index.js", - "./indexed-db": "./dist/indexed-db/index.js", - "./websocket": "./dist/websocket/index.js" + ".": "./src/index.ts", + "./in-memory": "./src/in-memory/index.ts", + "./async": "./src/async/index.ts", + "./indexed-db": "./src/indexed-db/index.ts", + "./websocket": "./src/websocket/index.ts" }, "publish": { - "exclude": ["!dist"] + "exclude": ["!src"] } } diff --git a/package.json b/package.json index d036124..32d45a8 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,11 @@ "name": "@sftsv/synk", "version": "0.0.3", "description": "A library for developing offline-first web applications based on async data replication and synchronization between clients and the server", - "type": "module", + "type": "commonjs", "module": "dist/index.mjs", "types": "dist/index.d.mts", "scripts": { - "build": "tsup", + "build": "tsc", "test": "vitest", "test:ui": "vitest --ui", "tsc": "tsc", diff --git a/tsconfig.json b/tsconfig.json index 75e5ebc..f9d5a99 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { "target": "es2016", - "module": "commonjs", + "module": "ESNext", + "moduleResolution": "Bundler", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, diff --git a/tsup.config.ts b/tsup.config.ts deleted file mode 100644 index b7d22d1..0000000 --- a/tsup.config.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { defineConfig } from "tsup" -import { glob } from "glob" - -const indexes = await glob("./src/**/index.ts", { - platform: "linux", -}) - -const replacePath = (path: string) => path.slice(4, -3) - -const entry = indexes.reduce( - (prev, curr) => ({ - ...prev, - [replacePath(curr)]: curr, - }), - {} -) - -console.log(entry) - -export default defineConfig({ - bundle: false, - entry, - dts: true, - format: "esm", - keepNames: true, -})