fix #1152: add the "--allow-overwrite" flag

This commit is contained in:
Evan Wallace
2021-04-22 14:01:20 -07:00
parent 4a1ce9a47f
commit 610d49bc96
10 changed files with 62 additions and 15 deletions

View File

@@ -197,12 +197,14 @@ function flagsForBuildOptions(
let absWorkingDir = getFlag(options, keys, 'absWorkingDir', mustBeString);
let stdin = getFlag(options, keys, 'stdin', mustBeObject);
let write = getFlag(options, keys, 'write', mustBeBoolean) ?? writeDefault; // Default to true if not specified
let allowOverwrite = getFlag(options, keys, 'allowOverwrite', mustBeBoolean);
let incremental = getFlag(options, keys, 'incremental', mustBeBoolean) === true;
keys.plugins = true; // "plugins" has already been read earlier
checkForInvalidFlags(options, keys, `in ${callName}() call`);
if (sourcemap) flags.push(`--sourcemap${sourcemap === true ? '' : `=${sourcemap}`}`);
if (bundle) flags.push('--bundle');
if (allowOverwrite) flags.push('--allow-overwrite');
if (watch) {
flags.push('--watch');
if (typeof watch === 'boolean') {

View File

@@ -47,6 +47,7 @@ export interface BuildOptions extends CommonOptions {
mainFields?: string[];
conditions?: string[];
write?: boolean;
allowOverwrite?: boolean;
tsconfig?: string;
outExtension?: { [ext: string]: string };
publicPath?: string;