1 | const safeThis = require('./utils/safeThis');
|
2 |
|
3 | if (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 | }
|