diff --git a/react-packager/src/Resolver/polyfills/require.js b/react-packager/src/Resolver/polyfills/require.js index c31ba095..219a4bad 100644 --- a/react-packager/src/Resolver/polyfills/require.js +++ b/react-packager/src/Resolver/polyfills/require.js @@ -120,7 +120,11 @@ function loadModuleImplementation(moduleId, module) { // keep args in sync with with defineModuleCode in // packager/react-packager/src/Resolver/index.js factory(global, require, moduleObject, exports); - module.factory = undefined; + + // avoid removing factory in DEV mode as it breaks HMR + if (!__DEV__) { + module.factory = undefined; + } if (__DEV__) { Systrace.endEvent();