Skip to content

Commit 8f90cb7

Browse files
committed
refactor: remove map: undefined from addRefreshWrapper
1 parent 2b00637 commit 8f90cb7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/common/refresh-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export const avoidSourceMapOption = Symbol()
1818

1919
export function addRefreshWrapper<M extends { mappings: string }>(
2020
code: string,
21-
map: M | string | undefined | typeof avoidSourceMapOption,
21+
map: M | string | typeof avoidSourceMapOption,
2222
pluginName: string,
2323
id: string,
24-
): { code: string; map: M | null | undefined | string } {
24+
): { code: string; map: M | null | string } {
2525
const hasRefresh = refreshContentRE.test(code)
2626
const onlyReactComp = !hasRefresh && reactCompRE.test(code)
2727
const normalizedMap = map === avoidSourceMapOption ? null : map

packages/plugin-react/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
255255
}
256256
return addRefreshWrapper(
257257
result.code!,
258-
result.map ?? undefined,
258+
result.map!,
259259
'@vitejs/plugin-react',
260260
id,
261261
)

0 commit comments

Comments
 (0)