[ci] yarn format
This commit is contained in:
parent
ed4969d113
commit
10d97b60b8
2 changed files with 85 additions and 3 deletions
|
@ -1,4 +1,45 @@
|
|||
const ERROR_STATUS_CODE_REGEXES = [ /400\/?$/,/401\/?$/,/402\/?$/,/403\/?$/,/404\/?$/,/405\/?$/,/406\/?$/,/407\/?$/,/408\/?$/,/409\/?$/,/410\/?$/,/411\/?$/,/412\/?$/,/413\/?$/,/414\/?$/,/415\/?$/,/416\/?$/,/417\/?$/,/418\/?$/,/421\/?$/,/422\/?$/,/423\/?$/,/424\/?$/,/425\/?$/,/426\/?$/,/428\/?$/,/429\/?$/,/431\/?$/,/451\/?$/,/500\/?$/,/501\/?$/,/502\/?$/,/503\/?$/,/504\/?$/,/505\/?$/,/506\/?$/,/507\/?$/,/508\/?$/,/510\/?$/,/511\/?$/ ];
|
||||
const ERROR_STATUS_CODE_REGEXES = [
|
||||
/400\/?$/,
|
||||
/401\/?$/,
|
||||
/402\/?$/,
|
||||
/403\/?$/,
|
||||
/404\/?$/,
|
||||
/405\/?$/,
|
||||
/406\/?$/,
|
||||
/407\/?$/,
|
||||
/408\/?$/,
|
||||
/409\/?$/,
|
||||
/410\/?$/,
|
||||
/411\/?$/,
|
||||
/412\/?$/,
|
||||
/413\/?$/,
|
||||
/414\/?$/,
|
||||
/415\/?$/,
|
||||
/416\/?$/,
|
||||
/417\/?$/,
|
||||
/418\/?$/,
|
||||
/421\/?$/,
|
||||
/422\/?$/,
|
||||
/423\/?$/,
|
||||
/424\/?$/,
|
||||
/425\/?$/,
|
||||
/426\/?$/,
|
||||
/428\/?$/,
|
||||
/429\/?$/,
|
||||
/431\/?$/,
|
||||
/451\/?$/,
|
||||
/500\/?$/,
|
||||
/501\/?$/,
|
||||
/502\/?$/,
|
||||
/503\/?$/,
|
||||
/504\/?$/,
|
||||
/505\/?$/,
|
||||
/506\/?$/,
|
||||
/507\/?$/,
|
||||
/508\/?$/,
|
||||
/510\/?$/,
|
||||
/511\/?$/,
|
||||
];
|
||||
|
||||
/** Construct sitemap.xml given a set of URLs */
|
||||
export function generateSitemap(pages: string[]): string {
|
||||
|
|
|
@ -25,7 +25,48 @@ const ASTRO_PAGE_PREFIX = '@astro-page';
|
|||
const ASTRO_SCRIPT_PREFIX = '@astro-script';
|
||||
|
||||
const ASTRO_EMPTY = '@astro-empty';
|
||||
const ERROR_STATUS_CODES = [ '400', '401', '402', '403', '404', '405', '406', '407', '408', '409', '410', '411', '412', '413', '414', '415', '416', '417', '418', '421', '422', '423', '424', '425', '426', '428', '429', '431', '451', '500', '501', '502', '503', '504', '505', '506', '507', '508', '510', '511' ];
|
||||
const ERROR_STATUS_CODES = [
|
||||
'400',
|
||||
'401',
|
||||
'402',
|
||||
'403',
|
||||
'404',
|
||||
'405',
|
||||
'406',
|
||||
'407',
|
||||
'408',
|
||||
'409',
|
||||
'410',
|
||||
'411',
|
||||
'412',
|
||||
'413',
|
||||
'414',
|
||||
'415',
|
||||
'416',
|
||||
'417',
|
||||
'418',
|
||||
'421',
|
||||
'422',
|
||||
'423',
|
||||
'424',
|
||||
'425',
|
||||
'426',
|
||||
'428',
|
||||
'429',
|
||||
'431',
|
||||
'451',
|
||||
'500',
|
||||
'501',
|
||||
'502',
|
||||
'503',
|
||||
'504',
|
||||
'505',
|
||||
'506',
|
||||
'507',
|
||||
'508',
|
||||
'510',
|
||||
'511',
|
||||
];
|
||||
|
||||
interface PluginOptions {
|
||||
astroConfig: AstroConfig;
|
||||
|
@ -483,7 +524,7 @@ export function rollupPluginAstroBuildHTML(options: PluginOptions): VitePlugin {
|
|||
|
||||
// Output directly to 404.html rather than 404/index.html
|
||||
// Supports any other status codes, too
|
||||
if (ERROR_STATUS_CODES.find(code => code === name) || astroConfig.buildOptions.pageUrlFormat === 'file') {
|
||||
if (ERROR_STATUS_CODES.find((code) => code === name) || astroConfig.buildOptions.pageUrlFormat === 'file') {
|
||||
outPath = `${removeEndingForwardSlash(name || 'index')}.html`;
|
||||
} else {
|
||||
outPath = npath.posix.join(name, 'index.html');
|
||||
|
|
Loading…
Reference in a new issue