Skip to content

Commit d6faa91

Browse files
committed
feat: add compatible bundle option
closes #318
1 parent e846e38 commit d6faa91

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/options/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,14 @@ async function resolveConfig(
206206
external,
207207
noExternal,
208208
exports = false,
209+
bundle,
210+
unbundle = typeof bundle === 'boolean' ? !bundle : false,
209211
} = userConfig
210212

213+
if (typeof bundle === 'boolean') {
214+
logger.warn('`bundle` option is deprecated. Use `unbundle` instead.')
215+
}
216+
211217
outDir = path.resolve(cwd, outDir)
212218
clean = resolveClean(clean, outDir, cwd)
213219

@@ -303,6 +309,7 @@ async function resolveConfig(
303309
external,
304310
noExternal,
305311
exports,
312+
unbundle,
306313
}
307314

308315
return config

src/options/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ export interface Options {
172172
*/
173173
unbundle?: boolean
174174

175+
/**
176+
* @deprecated Use `unbundle` instead.
177+
* @default true
178+
*/
179+
bundle?: boolean
180+
175181
define?: Record<string, string>
176182
/** @default false */
177183
shims?: boolean
@@ -387,7 +393,7 @@ export type ResolvedOptions = Omit<
387393
| 'copy'
388394
| 'loader'
389395
| 'name'
390-
| 'unbundle'
396+
| 'bundle'
391397
>,
392398
{
393399
format: NormalizedFormat[]

0 commit comments

Comments
 (0)