Skip to content

Commit

Permalink
fix(cli): convert special base (#14283)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea authored and bluwy committed Oct 3, 2023
1 parent df6f32f commit d4bc0fb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/vite/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,21 @@ const convertHost = (v: any) => {
return v
}

/**
* base may be a number (like 0), should convert to empty string
*/
const convertBase = (v: any) => {
if (v === 0) {
return ''
}
return v
}

cli
.option('-c, --config <file>', `[string] use specified config file`)
.option('--base <path>', `[string] public base path (default: /)`)
.option('--base <path>', `[string] public base path (default: /)`, {
type: [convertBase],
})
.option('-l, --logLevel <level>', `[string] info | warn | error | silent`)
.option('--clearScreen', `[boolean] allow/disable clear screen when logging`)
.option('-d, --debug [feat]', `[string | boolean] show debug logs`)
Expand Down

0 comments on commit d4bc0fb

Please # to comment.