HMRClientProdShim.js 740 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. * @flow strict-local
  9. */
  10. 'use strict';
  11. import type {HMRClientNativeInterface} from './HMRClient';
  12. // This shim ensures DEV binary builds don't crash in JS
  13. // when they're combined with a PROD JavaScript build.
  14. const HMRClientProdShim: HMRClientNativeInterface = {
  15. setup() {},
  16. enable() {
  17. console.error(
  18. 'Fast Refresh is disabled in JavaScript bundles built in production mode. ' +
  19. 'Did you forget to run Metro?',
  20. );
  21. },
  22. disable() {},
  23. registerBundle() {},
  24. log() {},
  25. };
  26. module.exports = HMRClientProdShim;