-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtsdown.config.ts
More file actions
31 lines (29 loc) · 871 Bytes
/
tsdown.config.ts
File metadata and controls
31 lines (29 loc) · 871 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
import { defineConfig, type UserConfig } from 'tsdown';
import { replacePlugin } from 'rolldown/plugins';
import path from 'node:path';
const packageJSON = await import(`file://${path.join(process.cwd(), 'package.json')}`, { with: { type: 'json' } }).then(m => m.default);
export function createTsdownConfig(options?: UserConfig) {
return defineConfig({
entry: ['src/index.ts'],
platform: 'node',
format: ['esm'],
target: 'esnext',
clean: true,
minify: false,
dts: true,
sourcemap: false,
treeshake: true,
outDir: './dist',
tsconfig: 'tsconfig.json',
plugins: [
replacePlugin({
'process.env.__VERSION__': `"${packageJSON.version}"`
})
],
deps: {
neverBundle: ['reciple', /^@reciple\//],
skipNodeModulesBundle: true
},
...options
});
}