ReactRefreshEntry.js 856 B

1234567891011121314151617181920212223
  1. /* global __react_refresh_library__ */
  2. const safeThis = require('core-js-pure/features/global-this');
  3. const RefreshRuntime = require('react-refresh/runtime');
  4. if (process.env.NODE_ENV !== 'production') {
  5. if (typeof safeThis !== 'undefined') {
  6. var $RefreshInjected$ = '__reactRefreshInjected';
  7. // Namespace the injected flag (if necessary) for monorepo compatibility
  8. if (typeof __react_refresh_library__ !== 'undefined' && __react_refresh_library__) {
  9. $RefreshInjected$ += '_' + __react_refresh_library__;
  10. }
  11. // Only inject the runtime if it hasn't been injected
  12. if (!safeThis[$RefreshInjected$]) {
  13. // Inject refresh runtime into global scope
  14. RefreshRuntime.injectIntoGlobalHook(safeThis);
  15. // Mark the runtime as injected to prevent double-injection
  16. safeThis[$RefreshInjected$] = true;
  17. }
  18. }
  19. }