0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

[ci] format

This commit is contained in:
liruifengv 2024-05-09 17:39:44 +00:00 committed by astrobot-houston
parent 4161a2a3d0
commit d8fe43fa23
2 changed files with 5 additions and 6 deletions

View file

@ -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: {

View file

@ -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);