UNPKG

500 BJavaScriptView Raw
1const safeThis = require('./utils/safeThis');
2
3if (process.env.NODE_ENV !== 'production' && typeof safeThis !== 'undefined') {
4 // Only inject the runtime if it hasn't been injected
5 if (!safeThis.__reactRefreshInjected) {
6 const RefreshRuntime = require('react-refresh/runtime');
7 // Inject refresh runtime into global scope
8 RefreshRuntime.injectIntoGlobalHook(safeThis);
9
10 // Mark the runtime as injected to prevent double-injection
11 safeThis.__reactRefreshInjected = true;
12 }
13}