Skip to content

Commit

Permalink
fix(cli): convert the sourcemap option to boolean (fix vitejs#13638) (v…
Browse files Browse the repository at this point in the history
  • Loading branch information
dd-jonas authored and xinxinhe1810 committed Jul 4, 2023
1 parent 73995e0 commit 0d138a2
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 0d138a2

Please sign in to comment.