mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
[ci] format
This commit is contained in:
parent
a05953538f
commit
498866c8f2
5 changed files with 7 additions and 10 deletions
|
@ -9,7 +9,7 @@ export function ensure404Route(manifest: ManifestData) {
|
||||||
params: [],
|
params: [],
|
||||||
pattern: /\/404/,
|
pattern: /\/404/,
|
||||||
prerender: false,
|
prerender: false,
|
||||||
segments: [[{ content: '404', dynamic: false,spread: false }]],
|
segments: [[{ content: '404', dynamic: false, spread: false }]],
|
||||||
type: 'page',
|
type: 'page',
|
||||||
route: '/404',
|
route: '/404',
|
||||||
fallbackRoutes: [],
|
fallbackRoutes: [],
|
||||||
|
|
|
@ -20,8 +20,8 @@ import { MissingIndexForInternationalization } from '../../errors/errors-data.js
|
||||||
import { AstroError } from '../../errors/index.js';
|
import { AstroError } from '../../errors/index.js';
|
||||||
import { removeLeadingForwardSlash, slash } from '../../path.js';
|
import { removeLeadingForwardSlash, slash } from '../../path.js';
|
||||||
import { resolvePages } from '../../util.js';
|
import { resolvePages } from '../../util.js';
|
||||||
import { getRouteGenerator } from './generator.js';
|
|
||||||
import { routeComparator } from '../priority.js';
|
import { routeComparator } from '../priority.js';
|
||||||
|
import { getRouteGenerator } from './generator.js';
|
||||||
const require = createRequire(import.meta.url);
|
const require = createRequire(import.meta.url);
|
||||||
|
|
||||||
interface Item {
|
interface Item {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { RouteData } from "../../@types/astro.js";
|
import type { RouteData } from '../../@types/astro.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comparator for sorting routes in resolution order.
|
* Comparator for sorting routes in resolution order.
|
||||||
|
|
|
@ -21,8 +21,8 @@ export async function getSortedPreloadedMatches({
|
||||||
settings,
|
settings,
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.sort((a,b) => routeComparator(a.route, b.route))
|
.sort((a, b) => routeComparator(a.route, b.route))
|
||||||
.sort((a, b) => prioritizePrerenderedMatchesComparator(a.route, b.route))
|
.sort((a, b) => prioritizePrerenderedMatchesComparator(a.route, b.route));
|
||||||
}
|
}
|
||||||
|
|
||||||
type PreloadAndSetPrerenderStatusParams = {
|
type PreloadAndSetPrerenderStatusParams = {
|
||||||
|
|
|
@ -285,10 +285,7 @@ export async function handleRoute({
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (
|
if (response.status === 404 && response.headers.get(REROUTE_DIRECTIVE_HEADER) !== 'no') {
|
||||||
response.status === 404 &&
|
|
||||||
response.headers.get(REROUTE_DIRECTIVE_HEADER) !== 'no'
|
|
||||||
) {
|
|
||||||
const fourOhFourRoute = await matchRoute('/404', manifestData, pipeline);
|
const fourOhFourRoute = await matchRoute('/404', manifestData, pipeline);
|
||||||
if (options)
|
if (options)
|
||||||
return handleRoute({
|
return handleRoute({
|
||||||
|
|
Loading…
Reference in a new issue