MCPcopy
hub / github.com/rolldown/tsdown / resolveUserConfig

Function resolveUserConfig

src/config/options.ts:45–396  ·  view source on GitHub ↗
(
  userConfig: UserConfig,
  inlineConfig: InlineConfig,
  configDeps: Set<string>,
)

Source from the content-addressed store, hash-verified

43 * @private
44 */
45export 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,

Callers 1

resolveConfigFunction · 0.90

Calls 15

flattenPluginsFunction · 0.90
readPackageJsonFunction · 0.90
generateColorFunction · 0.90
getNameLabelFunction · 0.90
createLoggerFunction · 0.90
resolveCleanFunction · 0.90
resolveEntryFunction · 0.90
resolveTargetFunction · 0.90
resolveTsconfigFunction · 0.90
hasExportsTypesFunction · 0.90
toArrayFunction · 0.90
loadViteConfigFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…