/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
packages/react-refresh-utils/rspack-runtime.ts
20 строк
703 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 RefreshRuntime from 'react-refresh/runtime' import type { RefreshRuntimeGlobals } from './runtime' declare const self: Window & RefreshRuntimeGlobals if (typeof self !== 'undefined') { var $RefreshInjected$ = '__reactRefreshInjected' // Only inject the runtime if it hasn't been injected if (!self[$RefreshInjected$]) { RefreshRuntime.injectIntoGlobalHook(self) // Empty implementation to avoid "ReferenceError: variable is not defined" in module which didn't pass builtin:react-refresh-loader self.$RefreshSig$ = () => (type) => type self.$RefreshReg$ = () => {} // Mark the runtime as injected to prevent double-injection self[$RefreshInjected$] = true } }