forked from marco10024/fastify-socket.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsup.config.ts
More file actions
24 lines (22 loc) · 751 Bytes
/
tsup.config.ts
File metadata and controls
24 lines (22 loc) · 751 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
import { defineConfig } from 'tsup'
import ts from 'typescript'
const cwd = process.cwd()
const tsConfigPath = ts.findConfigFile(
cwd,
ts.sys.fileExists,
'tsconfig.build.json',
)
if (!tsConfigPath) {
throw new Error(`tsconfig.json not found in the current directory! ${cwd}`)
}
const configFile = ts.readConfigFile(tsConfigPath, ts.sys.readFile)
const tsConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, cwd)
export default defineConfig((options) => ({
entry: [...tsConfig.fileNames],
outDir: options.outDir ?? tsConfig.options.outDir ?? 'dist',
sourcemap: tsConfig.options.sourceMap,
clean: true,
target: tsConfig.raw?.compilerOptions?.target ?? 'node16',
bundle: false,
dts: tsConfig.options.declaration,
}))