utils.js 634 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.isClientComponentModule = isClientComponentModule;
  6. var _constants = require("../../../shared/lib/constants");
  7. const imageExtensions = [
  8. "jpg",
  9. "jpeg",
  10. "png",
  11. "webp",
  12. "avif"
  13. ];
  14. const imageRegex = new RegExp(`\\.(${imageExtensions.join("|")})$`);
  15. function isClientComponentModule(mod) {
  16. var ref;
  17. const hasClientDirective = ((ref = mod.buildInfo.rsc) == null ? void 0 : ref.type) === _constants.RSC_MODULE_TYPES.client;
  18. return hasClientDirective || imageRegex.test(mod.resource);
  19. }
  20. //# sourceMappingURL=utils.js.map