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 committed Sep 4, 2023
1 parent 8f87e86 commit 34826aa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/vite/src/node/cli.ts
Expand Up @@ -111,9 +111,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 34826aa

Please sign in to comment.