create project

This commit is contained in:
ismailsosic
2022-12-27 12:05:56 +01:00
parent 2a33a2d3de
commit cd2143287c
16035 changed files with 2489703 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getRouteFromEntrypoint;
var _getAppRouteFromEntrypoint = _interopRequireDefault(require("./get-app-route-from-entrypoint"));
var _matchBundle = _interopRequireDefault(require("./match-bundle"));
function getRouteFromEntrypoint(entryFile, app) {
let pagePath = (0, _matchBundle).default(SERVER_ROUTE_NAME_REGEX, entryFile);
if (pagePath) {
return pagePath;
}
if (app) {
pagePath = (0, _getAppRouteFromEntrypoint).default(entryFile);
if (pagePath) return pagePath;
}
// Potentially the passed item is a browser bundle so we try to match that also
return (0, _matchBundle).default(BROWSER_ROUTE_NAME_REGEX, entryFile);
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
// matches pages/:page*.js
const SERVER_ROUTE_NAME_REGEX = /^pages[/\\](.*)$/;
// matches static/pages/:page*.js
const BROWSER_ROUTE_NAME_REGEX = /^static[/\\]pages[/\\](.*)$/;
//# sourceMappingURL=get-route-from-entrypoint.js.map