Skip to content

Commit

Permalink
fix(cli): convert the sourcemap option to boolean (fix #13638) (#13663)
Browse files Browse the repository at this point in the history
  • Loading branch information
dd-jonas authored Jun 29, 2023
1 parent bfad16c commit d444bfe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/vite/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ function cleanOptions<Options extends GlobalCLIOptions>(
delete ret.filter
delete ret.m
delete ret.mode

// convert the sourcemap option to a boolean if necessary
if ('sourcemap' in ret) {
const sourcemap = ret.sourcemap as `${boolean}` | 'inline' | 'hidden'
ret.sourcemap =
sourcemap === 'true'
? true
: sourcemap === 'false'
? false
: ret.sourcemap
}

return ret
}

Expand Down

0 comments on commit d444bfe

Please sign in to comment.