/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
packages/react-refresh-utils/ReactRefreshRspackPlugin.ts
24 строки
686 B
Cong-Cong Pan
fix(Rspack): resolve HMR unresponsiveness or unexpected full reload & update dev snapshot (#83480)
16 сен 2025, 04:26
Не верифицирован
16 сен 2025, 04:26
5712c05
Код
Авторство
О чём код?
import type { Compiler } from 'webpack' const PLUGIN_NAME = 'ReactRefreshRspackPlugin' class ReactRefreshRspackPlugin { static loader = 'builtin:react-refresh-loader' apply(compiler: Compiler) { new compiler.webpack.ProvidePlugin({ $ReactRefreshRuntime$: require.resolve('./internal/RspackReactRefresh'), }).apply(compiler) compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => { compilation.hooks.additionalTreeRuntimeRequirements.tap( PLUGIN_NAME, (_, runtimeRequirements) => { runtimeRequirements.add(compiler.webpack.RuntimeGlobals.moduleCache) } ) }) } } export default ReactRefreshRspackPlugin