get-app-route-from-entrypoint.js 717 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = getAppRouteFromEntrypoint;
  6. var _matchBundle = _interopRequireDefault(require("./match-bundle"));
  7. function getAppRouteFromEntrypoint(entryFile) {
  8. const pagePath = (0, _matchBundle).default(APP_ROUTE_NAME_REGEX, entryFile);
  9. if (typeof pagePath === "string" && !pagePath) {
  10. return "/";
  11. }
  12. if (!pagePath) {
  13. return null;
  14. }
  15. return pagePath;
  16. }
  17. function _interopRequireDefault(obj) {
  18. return obj && obj.__esModule ? obj : {
  19. default: obj
  20. };
  21. }
  22. // matches app/:path*.js
  23. const APP_ROUTE_NAME_REGEX = /^app[/\\](.*)$/;
  24. //# sourceMappingURL=get-app-route-from-entrypoint.js.map