summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/actions/index.ts7
-rw-r--r--packages/astro/src/vite-plugin-astro-server/route.ts4
2 files changed, 5 insertions, 6 deletions
diff --git a/packages/astro/src/actions/index.ts b/packages/astro/src/actions/index.ts
index 1c3a55513..045bdd10f 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 cc8439fa5..95dd98135 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);