96954.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. exports.id = 96954;
  2. exports.ids = [96954];
  3. exports.modules = {
  4. /***/ 96954:
  5. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  6. module.exports = __webpack_require__(56773)
  7. /***/ }),
  8. /***/ 56773:
  9. /***/ ((module, exports, __webpack_require__) => {
  10. "use strict";
  11. "client";
  12. Object.defineProperty(exports, "__esModule", ({
  13. value: true
  14. }));
  15. exports["default"] = dynamic;
  16. exports.noSSR = noSSR;
  17. var _extends = (__webpack_require__(25550)/* ["default"] */ .Z);
  18. var _interop_require_default = (__webpack_require__(40213)/* ["default"] */ .Z);
  19. var _react = _interop_require_default(__webpack_require__(16689));
  20. var _loadable = _interop_require_default(__webpack_require__(95832));
  21. function dynamic(dynamicOptions, options) {
  22. let loadableFn = _loadable.default;
  23. let loadableOptions = (options == null ? void 0 : options.suspense) ? {} : {
  24. // A loading component is not required, so we default it
  25. loading: ({ error , isLoading , pastDelay })=>{
  26. if (!pastDelay) return null;
  27. if (false) {}
  28. return null;
  29. }
  30. };
  31. // Support for direct import(), eg: dynamic(import('../hello-world'))
  32. // Note that this is only kept for the edge case where someone is passing in a promise as first argument
  33. // The react-loadable babel plugin will turn dynamic(import('../hello-world')) into dynamic(() => import('../hello-world'))
  34. // To make sure we don't execute the import without rendering first
  35. if (dynamicOptions instanceof Promise) {
  36. loadableOptions.loader = ()=>dynamicOptions;
  37. // Support for having import as a function, eg: dynamic(() => import('../hello-world'))
  38. } else if (typeof dynamicOptions === "function") {
  39. loadableOptions.loader = dynamicOptions;
  40. // Support for having first argument being options, eg: dynamic({loader: import('../hello-world')})
  41. } else if (typeof dynamicOptions === "object") {
  42. loadableOptions = _extends({}, loadableOptions, dynamicOptions);
  43. }
  44. // Support for passing options, eg: dynamic(import('../hello-world'), {loading: () => <p>Loading something</p>})
  45. loadableOptions = _extends({}, loadableOptions, options);
  46. // Error if Fizz rendering is not enabled and `suspense` option is set to true
  47. if ( true && loadableOptions.suspense) {
  48. throw new Error(`Invalid suspense option usage in next/dynamic. Read more: https://nextjs.org/docs/messages/invalid-dynamic-suspense`);
  49. }
  50. if (loadableOptions.suspense) {
  51. if (false) {}
  52. delete loadableOptions.ssr;
  53. delete loadableOptions.loading;
  54. }
  55. // coming from build/babel/plugins/react-loadable-plugin.js
  56. if (loadableOptions.loadableGenerated) {
  57. loadableOptions = _extends({}, loadableOptions, loadableOptions.loadableGenerated);
  58. delete loadableOptions.loadableGenerated;
  59. }
  60. // support for disabling server side rendering, eg: dynamic(import('../hello-world'), {ssr: false}).
  61. // skip `ssr` for suspense mode and opt-in React.lazy directly
  62. if (typeof loadableOptions.ssr === "boolean" && !loadableOptions.suspense) {
  63. if (!loadableOptions.ssr) {
  64. delete loadableOptions.ssr;
  65. return noSSR(loadableFn, loadableOptions);
  66. }
  67. delete loadableOptions.ssr;
  68. }
  69. return loadableFn(loadableOptions);
  70. }
  71. "client";
  72. const isServerSide = "undefined" === "undefined";
  73. function noSSR(LoadableInitializer, loadableOptions) {
  74. // Removing webpack and modules means react-loadable won't try preloading
  75. delete loadableOptions.webpack;
  76. delete loadableOptions.modules;
  77. // This check is necessary to prevent react-loadable from initializing on the server
  78. if (!isServerSide) {
  79. return LoadableInitializer(loadableOptions);
  80. }
  81. const Loading = loadableOptions.loading;
  82. // This will only be rendered on the server side
  83. return ()=>/*#__PURE__*/ _react.default.createElement(Loading, {
  84. error: null,
  85. isLoading: true,
  86. pastDelay: false,
  87. timedOut: false
  88. });
  89. }
  90. if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
  91. Object.defineProperty(exports.default, "__esModule", {
  92. value: true
  93. });
  94. Object.assign(exports.default, exports);
  95. module.exports = exports.default;
  96. } //# sourceMappingURL=dynamic.js.map
  97. /***/ })
  98. };
  99. ;
  100. //# sourceMappingURL=96954.js.map