Skip to content

Commit 1ee1e94

Browse files
committed
🔧 output all paths with tsup
1 parent dca5973 commit 1ee1e94

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "@sftsv/synk",
33
"version": "0.0.3",
44
"description": "A library for developing offline-first web applications based on async data replication and synchronization between clients and the server",
5-
"main": "dist/index.js",
5+
"type": "module",
66
"module": "dist/index.mjs",
7-
"types": "dist/index.d.ts",
7+
"types": "dist/index.d.mts",
88
"scripts": {
9-
"build": "tsup src/index --format cjs,esm --dts",
9+
"build": "tsup",
1010
"test": "vitest",
1111
"test:ui": "vitest --ui",
1212
"tsc": "tsc",
@@ -20,6 +20,7 @@
2020
"author": "",
2121
"license": "GPL-3.0-only",
2222
"dependencies": {
23+
"glob": "^10.3.10",
2324
"tsup": "^8.0.2",
2425
"ws": "^8.15.1",
2526
"zod": "^3.22.4"

pnpm-lock.yaml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsup.config.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig } from "tsup"
2+
import { glob } from "glob"
3+
4+
const indexes = await glob("./src/**/index.ts", {
5+
platform: "linux",
6+
})
7+
8+
const replacePath = (path: string) => path.slice(4, -3)
9+
10+
const entry = indexes.reduce(
11+
(prev, curr) => ({
12+
...prev,
13+
[replacePath(curr)]: curr,
14+
}),
15+
{}
16+
)
17+
18+
console.log(entry)
19+
20+
export default defineConfig({
21+
bundle: false,
22+
entry,
23+
dts: true,
24+
format: "esm",
25+
keepNames: true,
26+
})

0 commit comments

Comments
 (0)