( userConfig: UserConfig, inlineConfig: InlineConfig, configDeps: Set<string>, )
| 43 | * @private |
| 44 | */ |
| 45 | export async function resolveUserConfig( |
| 46 | userConfig: UserConfig, |
| 47 | inlineConfig: InlineConfig, |
| 48 | configDeps: Set<string>, |
| 49 | ): Promise<ResolvedConfig[]> { |
| 50 | // Dispatch `tsdownConfig` hook on user plugins before any resolution work. |
| 51 | // Plugins are snapshotted: new plugins added by a hook don't re-dispatch, |
| 52 | // preventing infinite recursion and matching Vite's `config` semantics. |
| 53 | { |
| 54 | const flat = await flattenPlugins(userConfig.plugins) |
| 55 | for (const plugin of flat) { |
| 56 | const result = await plugin.tsdownConfig?.(userConfig, inlineConfig) |
| 57 | if (result) { |
| 58 | userConfig = mergeConfig(userConfig, result) |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | let { |
| 64 | entry, |
| 65 | format, |
| 66 | plugins = [], |
| 67 | clean = true, |
| 68 | logLevel = 'info', |
| 69 | failOnWarn = false, |
| 70 | customLogger, |
| 71 | treeshake = true, |
| 72 | platform = 'node', |
| 73 | outDir = 'dist', |
| 74 | sourcemap = false, |
| 75 | dts, |
| 76 | unused = false, |
| 77 | watch = false, |
| 78 | ignoreWatch, |
| 79 | shims = false, |
| 80 | publint = false, |
| 81 | attw = false, |
| 82 | fromVite, |
| 83 | alias, |
| 84 | tsconfig, |
| 85 | report = true, |
| 86 | target, |
| 87 | env = {}, |
| 88 | envFile, |
| 89 | envPrefix = 'TSDOWN_', |
| 90 | copy, |
| 91 | publicDir, |
| 92 | hash = true, |
| 93 | cwd = process.cwd(), |
| 94 | name, |
| 95 | workspace, |
| 96 | exports = false, |
| 97 | bundle, |
| 98 | unbundle = typeof bundle === 'boolean' ? !bundle : false, |
| 99 | root, |
| 100 | removeNodeProtocol, |
| 101 | nodeProtocol, |
| 102 | cjsDefault = true, |
no test coverage detected
searching dependent graphs…