-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
34 lines (31 loc) · 921 Bytes
/
tsdown.config.ts
File metadata and controls
34 lines (31 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import Module from "node:module";
import { defineConfig } from "tsdown";
import Raw from "unplugin-raw/rolldown";
export default defineConfig({
entry: ["./src/index.ts", "./src/vendor", "./src/cli.ts"],
clean: true,
// unbundle: true,
// Since we bundled changelogen -> node-fetch-native,
// we expect these patches to reduce the bundle size.
// https://github.com/rolldown/tsdown/issues/611
platform: "neutral",
deps: {
neverBundle: [
...Module.builtinModules,
...Module.builtinModules.map(m => `node:${m}`),
],
alwaysBundle: [
"changelogen",
],
},
// dts: {
// resolve: ["changelogen"],
// },
// I think the default chunk naming in unbuild is very elegant,
// so we config for it in tsdown.
// https://github.com/rolldown/tsdown/discussions/612
outputOptions: {
chunkFileNames: "shared/scaffold-[name]-[hash].mjs",
},
plugins: [Raw()],
});