Skip to content

Commit 3473bbb

Browse files
committed
feat: add @vitejs/plugin-react-swc/preamble
1 parent 51071ac commit 3473bbb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
getPreambleCode,
1717
runtimePublicPath,
1818
silenceUseClientWarning,
19+
virtualPreamblePlugin,
1920
} from '@vitejs/react-common'
2021
import * as vite from 'vite'
2122
import { exactRegex } from '@rolldown/pluginutils'
@@ -246,6 +247,10 @@ const react = (_options?: Options): Plugin[] => {
246247
viteCacheRoot = config.cacheDir
247248
},
248249
},
250+
virtualPreamblePlugin({
251+
name: '@vitejs/plugin-react-swc/preamble',
252+
isEnabled: () => !hmrDisabled,
253+
}),
249254
]
250255
}
251256

0 commit comments

Comments
 (0)