11/* global __webpack_require__ */
2- var Refresh = require ( 'react-refresh/runtime' ) ;
2+ import {
3+ getFamilyByType ,
4+ isLikelyComponentType ,
5+ performReactRefresh ,
6+ register ,
7+ } from 'react-refresh/runtime' ;
38
49/**
510 * Extracts exports from a webpack module object.
@@ -45,7 +50,7 @@ function getModuleExports(moduleId) {
4550 */
4651function getReactRefreshBoundarySignature ( moduleExports ) {
4752 var signature = [ ] ;
48- signature . push ( Refresh . getFamilyByType ( moduleExports ) ) ;
53+ signature . push ( getFamilyByType ( moduleExports ) ) ;
4954
5055 if ( moduleExports == null || typeof moduleExports !== 'object' ) {
5156 // Exit if we can't iterate over exports.
@@ -58,7 +63,7 @@ function getReactRefreshBoundarySignature(moduleExports) {
5863 }
5964
6065 signature . push ( key ) ;
61- signature . push ( Refresh . getFamilyByType ( moduleExports [ key ] ) ) ;
66+ signature . push ( getFamilyByType ( moduleExports [ key ] ) ) ;
6267 }
6368
6469 return signature ;
@@ -84,7 +89,7 @@ function createDebounceUpdate() {
8489 if ( typeof refreshTimeout === 'undefined' ) {
8590 refreshTimeout = setTimeout ( function ( ) {
8691 refreshTimeout = undefined ;
87- Refresh . performReactRefresh ( ) ;
92+ performReactRefresh ( ) ;
8893 if ( callback ) {
8994 callback ( ) ;
9095 }
@@ -103,7 +108,7 @@ function createDebounceUpdate() {
103108 * @returns {boolean } Whether the exports are React component like.
104109 */
105110function isReactRefreshBoundary ( moduleExports ) {
106- if ( Refresh . isLikelyComponentType ( moduleExports ) ) {
111+ if ( isLikelyComponentType ( moduleExports ) ) {
107112 return true ;
108113 }
109114 if (
@@ -130,7 +135,7 @@ function isReactRefreshBoundary(moduleExports) {
130135 // without any side-effects attached.
131136 // Ref: https://github.com/webpack/webpack/blob/b93048643fe74de2a6931755911da1212df55897/lib/MainTemplate.js#L281
132137 var exportValue = moduleExports [ key ] ;
133- if ( ! Refresh . isLikelyComponentType ( exportValue ) ) {
138+ if ( ! isLikelyComponentType ( exportValue ) ) {
134139 areAllExportsComponents = false ;
135140 }
136141 }
@@ -147,9 +152,9 @@ function isReactRefreshBoundary(moduleExports) {
147152 * @returns {void }
148153 */
149154function registerExportsForReactRefresh ( moduleExports , moduleId ) {
150- if ( Refresh . isLikelyComponentType ( moduleExports ) ) {
155+ if ( isLikelyComponentType ( moduleExports ) ) {
151156 // Register module.exports if it is likely a component
152- Refresh . register ( moduleExports , moduleId + ' %exports%' ) ;
157+ register ( moduleExports , moduleId + ' %exports%' ) ;
153158 }
154159
155160 if (
@@ -168,9 +173,9 @@ function registerExportsForReactRefresh(moduleExports, moduleId) {
168173 }
169174
170175 var exportValue = moduleExports [ key ] ;
171- if ( Refresh . isLikelyComponentType ( exportValue ) ) {
176+ if ( isLikelyComponentType ( exportValue ) ) {
172177 var typeID = moduleId + ' %exports% ' + key ;
173- Refresh . register ( exportValue , typeID ) ;
178+ register ( exportValue , typeID ) ;
174179 }
175180 }
176181}
@@ -273,11 +278,11 @@ function isUnrecoverableRuntimeError(error) {
273278 return error . message . startsWith ( 'RuntimeError: factory is undefined' ) ;
274279}
275280
276- module . exports = Object . freeze ( {
277- enqueueUpdate : enqueueUpdate ,
278- executeRuntime : executeRuntime ,
279- getModuleExports : getModuleExports ,
280- isReactRefreshBoundary : isReactRefreshBoundary ,
281- shouldInvalidateReactRefreshBoundary : shouldInvalidateReactRefreshBoundary ,
282- registerExportsForReactRefresh : registerExportsForReactRefresh ,
283- } ) ;
281+ export {
282+ enqueueUpdate ,
283+ executeRuntime ,
284+ getModuleExports ,
285+ isReactRefreshBoundary ,
286+ registerExportsForReactRefresh ,
287+ shouldInvalidateReactRefreshBoundary ,
288+ } ;
0 commit comments