From d8fe43fa232a1a56c70a62a99fcb84a0583cf2ca Mon Sep 17 00:00:00 2001 From: liruifengv Date: Thu, 9 May 2024 17:39:44 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/actions/index.ts | 7 ++++--- packages/astro/src/vite-plugin-astro-server/route.ts | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/astro/src/actions/index.ts b/packages/astro/src/actions/index.ts index 1c3a555139..045bdd10f6 100644 --- a/packages/astro/src/actions/index.ts +++ b/packages/astro/src/actions/index.ts @@ -1,16 +1,17 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises'; import type { Plugin as VitePlugin } from 'vite'; import type { AstroIntegration } from '../@types/astro.js'; -import { ACTIONS_TYPES_FILE, RESOLVED_VIRTUAL_MODULE_ID, VIRTUAL_MODULE_ID } from './consts.js'; import { viteID } from '../core/util.js'; - +import { ACTIONS_TYPES_FILE, RESOLVED_VIRTUAL_MODULE_ID, VIRTUAL_MODULE_ID } from './consts.js'; export default function astroActions(): AstroIntegration { return { name: VIRTUAL_MODULE_ID, hooks: { async 'astro:config:setup'(params) { - const stringifiedActionsImport = JSON.stringify(viteID(new URL('./actions', params.config.srcDir))); + const stringifiedActionsImport = JSON.stringify( + viteID(new URL('./actions', params.config.srcDir)) + ); params.updateConfig({ vite: { define: { diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index cc8439fa56..95dd981351 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -81,9 +81,7 @@ export async function matchRoute( // Try without `.html` extensions or `index.html` in request URLs to mimic // routing behavior in production builds. This supports both file and directory // build formats, and is necessary based on how the manifest tracks build targets. - const altPathname = pathname - .replace(/\/index\.html$/, '/') - .replace(/\.html$/, ''); + const altPathname = pathname.replace(/\/index\.html$/, '/').replace(/\.html$/, ''); if (altPathname !== pathname) { return await matchRoute(altPathname, manifestData, pipeline);