mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-05 10:41:56 +03:00
Remove obsolete conditional.
This commit is contained in:
parent
1b69602e84
commit
972218e0cb
@ -55,25 +55,22 @@ function generate(scanned) {
|
|||||||
pathFragments = pathFragments.replace(/\.[^/.]+$/, "").split(path.sep);
|
pathFragments = pathFragments.replace(/\.[^/.]+$/, "").split(path.sep);
|
||||||
const is404 = pathFragments.length == 1 && pathFragments[0] == "404";
|
const is404 = pathFragments.length == 1 && pathFragments[0] == "404";
|
||||||
const ext = path.extname(scanned[i].path);
|
const ext = path.extname(scanned[i].path);
|
||||||
if (scanned[i].document) {
|
|
||||||
// const elmType = pathFragments.map(toPascalCase).join("");
|
// const elmType = pathFragments.map(toPascalCase).join("");
|
||||||
const elmType =
|
const elmType =
|
||||||
"(PageRoute [ " +
|
"(PageRoute [ " +
|
||||||
pathFragments
|
pathFragments
|
||||||
.filter(fragment => fragment !== "index")
|
.filter(fragment => fragment !== "index")
|
||||||
.map(fragment => `"${fragment}"`)
|
.map(fragment => `"${fragment}"`)
|
||||||
.join(", ") +
|
.join(", ") +
|
||||||
" ])";
|
" ])";
|
||||||
if (!is404) {
|
if (!is404) {
|
||||||
captureRouteRecord(pathFragments, elmType, routeRecord);
|
captureRouteRecord(pathFragments, elmType, routeRecord);
|
||||||
allRoutes.push(elmType);
|
allRoutes.push(elmType);
|
||||||
urlParser.push(formatUrlParser(elmType, pathFragments));
|
urlParser.push(formatUrlParser(elmType, pathFragments));
|
||||||
// routeToMetadata.push(formatCaseInstance(elmType, scanned[i].metadata));
|
// routeToMetadata.push(formatCaseInstance(elmType, scanned[i].metadata));
|
||||||
// routeToExt.push(formatCaseInstance(elmType, ext));
|
// routeToExt.push(formatCaseInstance(elmType, ext));
|
||||||
// routeToSource.push(formatCaseInstance(elmType, scanned[i].path));
|
// routeToSource.push(formatCaseInstance(elmType, scanned[i].path));
|
||||||
}
|
|
||||||
} else {
|
|
||||||
captureRouteRecord(pathFragments, scanned[i].path, assetsRecord);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user