Skip to content

Commit 3c4b357

Browse files
committed
feat: add cjsDts to input/output options context
closes #371
1 parent 54e21e1 commit 3c4b357

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ async function getBuildOptions(
263263
plugins.push(userPlugins)
264264
}
265265

266+
cjsDts = !!cjsDts
266267
const inputOptions = await mergeUserOptions(
267268
{
268269
input: entry,
@@ -293,7 +294,7 @@ async function getBuildOptions(
293294
moduleTypes: loader,
294295
},
295296
config.inputOptions,
296-
[format],
297+
[format, { cjsDts }],
297298
)
298299

299300
const [entryFileNames, chunkFileNames] = resolveChunkFilename(
@@ -318,7 +319,7 @@ async function getBuildOptions(
318319
footer: resolveChunkAddon(footer, format),
319320
},
320321
config.outputOptions,
321-
[format],
322+
[format, { cjsDts }],
322323
)
323324

324325
return {

src/options/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export interface Options {
9898
| ((
9999
options: InputOptions,
100100
format: NormalizedFormat,
101+
context: { cjsDts: boolean },
101102
) => Awaitable<InputOptions | void | null>)
102103

103104
/// output options
@@ -182,6 +183,7 @@ export interface Options {
182183
| ((
183184
options: OutputOptions,
184185
format: NormalizedFormat,
186+
context: { cjsDts: boolean },
185187
) => Awaitable<OutputOptions | void | null>)
186188

187189
/** @default true */

0 commit comments

Comments
 (0)