Skip to content

Commit e31f225

Browse files
committed
fix: don't parse source map if not needed
Related commit: 2ea890a
1 parent d144462 commit e31f225

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/plugin-react-swc/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,9 @@ const react = (_options?: Options): PluginOption[] => {
147147
if (!result) return
148148
if (!refresh) return result
149149

150-
const sourceMap: SourceMapPayload = JSON.parse(result.map!)
151-
return addRefreshWrapper(
150+
return addRefreshWrapper<SourceMapPayload>(
152151
result.code,
153-
sourceMap,
152+
result.map!,
154153
'@vitejs/plugin-react-swc',
155154
id,
156155
)

0 commit comments

Comments
 (0)