Skip to content

Commit d444bfe

Browse files
authoredJun 29, 2023
fix(cli): convert the sourcemap option to boolean (fix #13638) (#13663)
1 parent bfad16c commit d444bfe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎packages/vite/src/node/cli.ts

+12
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ function cleanOptions<Options extends GlobalCLIOptions>(
8787
delete ret.filter
8888
delete ret.m
8989
delete ret.mode
90+
91+
// convert the sourcemap option to a boolean if necessary
92+
if ('sourcemap' in ret) {
93+
const sourcemap = ret.sourcemap as `${boolean}` | 'inline' | 'hidden'
94+
ret.sourcemap =
95+
sourcemap === 'true'
96+
? true
97+
: sourcemap === 'false'
98+
? false
99+
: ret.sourcemap
100+
}
101+
90102
return ret
91103
}
92104

0 commit comments

Comments
 (0)
Please sign in to comment.