mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
14 lines
500 B
JavaScript
14 lines
500 B
JavaScript
const safeThis = require('./utils/safeThis');
|
|
|
|
if (process.env.NODE_ENV !== 'production' && typeof safeThis !== 'undefined') {
|
|
// Only inject the runtime if it hasn't been injected
|
|
if (!safeThis.__reactRefreshInjected) {
|
|
const RefreshRuntime = require('react-refresh/runtime');
|
|
// Inject refresh runtime into global scope
|
|
RefreshRuntime.injectIntoGlobalHook(safeThis);
|
|
|
|
// Mark the runtime as injected to prevent double-injection
|
|
safeThis.__reactRefreshInjected = true;
|
|
}
|
|
}
|