next-page-disallow-re-export-all-exports.js 918 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = NextPageDisallowReExportAllExports;
  6. function NextPageDisallowReExportAllExports() {
  7. return {
  8. visitor: {
  9. ExportAllDeclaration (path) {
  10. var ref, ref1;
  11. const err = new SyntaxError(`Using \`export * from '...'\` in a page is disallowed. Please use \`export { default } from '...'\` instead.\n` + `Read more: https://nextjs.org/docs/messages/export-all-in-page`);
  12. err.code = "BABEL_PARSE_ERROR";
  13. var ref2, ref3;
  14. err.loc = (ref3 = (ref2 = (ref = path.node.loc) == null ? void 0 : ref.start) != null ? ref2 : (ref1 = path.node.loc) == null ? void 0 : ref1.end) != null ? ref3 : path.node.loc;
  15. throw err;
  16. }
  17. }
  18. };
  19. }
  20. //# sourceMappingURL=next-page-disallow-re-export-all-exports.js.map