diff --git a/packages/astro/src/core/app/index.ts b/packages/astro/src/core/app/index.ts index 00b93cd09c..ae0c3fb00e 100644 --- a/packages/astro/src/core/app/index.ts +++ b/packages/astro/src/core/app/index.ts @@ -1,3 +1,4 @@ +import mime from 'mime'; import type { EndpointHandler, ManifestData, @@ -6,8 +7,6 @@ import type { SSRElement, SSRManifest, } from '../../@types/astro'; -import type { RouteInfo } from './types'; -import mime from 'mime'; import type { SinglePageBuiltModule } from '../build/types'; import { attachToResponse, getSetCookiesFromResponse } from '../cookies/index.js'; import { callEndpoint, createAPIContext } from '../endpoint/index.js'; @@ -29,6 +28,7 @@ import { createStylesheetElementSet, } from '../render/ssr-element.js'; import { matchRoute } from '../routing/match.js'; +import type { RouteInfo } from './types'; export { deserializeManifest } from './common.js'; const clientLocalsSymbol = Symbol.for('astro.locals'); diff --git a/packages/astro/src/core/build/internal.ts b/packages/astro/src/core/build/internal.ts index 7a13e4d08a..8c7da07d43 100644 --- a/packages/astro/src/core/build/internal.ts +++ b/packages/astro/src/core/build/internal.ts @@ -4,8 +4,8 @@ import type { PageOptions } from '../../vite-plugin-astro/types'; import { prependForwardSlash, removeFileExtension } from '../path.js'; import { viteID } from '../util.js'; import { ASTRO_PAGE_MODULE_ID, getVirtualModulePageIdFromPath } from './plugins/plugin-pages.js'; -import type { PageBuildData, StylesheetAsset, ViteID } from './types'; import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from './plugins/util.js'; +import type { PageBuildData, StylesheetAsset, ViteID } from './types'; export interface BuildInternals { /** diff --git a/packages/astro/src/core/build/plugins/plugin-pages.ts b/packages/astro/src/core/build/plugins/plugin-pages.ts index ca224d851d..c40449a39e 100644 --- a/packages/astro/src/core/build/plugins/plugin-pages.ts +++ b/packages/astro/src/core/build/plugins/plugin-pages.ts @@ -1,4 +1,4 @@ -import { getPathFromVirtualModulePageName, ASTRO_PAGE_EXTENSION_POST_PATTERN } from './util.js'; +import { extname } from 'node:path'; import type { Plugin as VitePlugin } from 'vite'; import { routeIsRedirect } from '../../redirects/index.js'; import { addRollupInput } from '../add-rollup-input.js'; @@ -7,7 +7,7 @@ import type { AstroBuildPlugin } from '../plugin'; import type { StaticBuildOptions } from '../types'; import { MIDDLEWARE_MODULE_ID } from './plugin-middleware.js'; import { RENDERERS_MODULE_ID } from './plugin-renderers.js'; -import { extname } from 'node:path'; +import { ASTRO_PAGE_EXTENSION_POST_PATTERN, getPathFromVirtualModulePageName } from './util.js'; export const ASTRO_PAGE_MODULE_ID = '@astro-page:'; export const ASTRO_PAGE_RESOLVED_MODULE_ID = '\0' + ASTRO_PAGE_MODULE_ID; diff --git a/packages/astro/src/core/build/plugins/plugin-ssr.ts b/packages/astro/src/core/build/plugins/plugin-ssr.ts index f9ba919092..486c314340 100644 --- a/packages/astro/src/core/build/plugins/plugin-ssr.ts +++ b/packages/astro/src/core/build/plugins/plugin-ssr.ts @@ -1,4 +1,5 @@ import glob from 'fast-glob'; +import { join } from 'node:path'; import { fileURLToPath, pathToFileURL } from 'node:url'; import type { Plugin as VitePlugin } from 'vite'; import type { AstroAdapter, AstroConfig } from '../../../@types/astro'; @@ -14,10 +15,9 @@ import { getOutFile, getOutFolder } from '../common.js'; import { cssOrder, mergeInlineCss, type BuildInternals } from '../internal.js'; import type { AstroBuildPlugin } from '../plugin'; import type { OutputChunk, StaticBuildOptions } from '../types'; -import { getPathFromVirtualModulePageName, getVirtualModulePageNameFromPath } from './util.js'; -import { RENDERERS_MODULE_ID } from './plugin-renderers.js'; import { ASTRO_PAGE_MODULE_ID } from './plugin-pages.js'; -import { join } from 'node:path'; +import { RENDERERS_MODULE_ID } from './plugin-renderers.js'; +import { getPathFromVirtualModulePageName, getVirtualModulePageNameFromPath } from './util.js'; export const SSR_VIRTUAL_MODULE_ID = '@astrojs-ssr-virtual-entry'; const RESOLVED_SSR_VIRTUAL_MODULE_ID = '\0' + SSR_VIRTUAL_MODULE_ID; diff --git a/packages/astro/src/core/build/plugins/util.ts b/packages/astro/src/core/build/plugins/util.ts index 1fbf0fcdc1..fa79d72bdf 100644 --- a/packages/astro/src/core/build/plugins/util.ts +++ b/packages/astro/src/core/build/plugins/util.ts @@ -1,5 +1,5 @@ -import type { Plugin as VitePlugin } from 'vite'; import { extname } from 'node:path'; +import type { Plugin as VitePlugin } from 'vite'; // eslint-disable-next-line @typescript-eslint/ban-types type OutputOptionsHook = Extract; diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index e783c28b11..a7d8354501 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -3,9 +3,11 @@ import * as eslexer from 'es-module-lexer'; import glob from 'fast-glob'; import fs from 'fs'; import { bgGreen, bgMagenta, black, dim } from 'kleur/colors'; +import { extname } from 'node:path'; import path from 'path'; import { fileURLToPath } from 'url'; import * as vite from 'vite'; +import type { RouteData } from '../../@types/astro'; import { createBuildInternals, eachPageData, @@ -28,11 +30,9 @@ import { MIDDLEWARE_MODULE_ID } from './plugins/plugin-middleware.js'; import { ASTRO_PAGE_RESOLVED_MODULE_ID } from './plugins/plugin-pages.js'; import { RESOLVED_RENDERERS_MODULE_ID } from './plugins/plugin-renderers.js'; import { RESOLVED_SPLIT_MODULE_ID, SSR_VIRTUAL_MODULE_ID } from './plugins/plugin-ssr.js'; -import type { AllPagesData, PageBuildData, StaticBuildOptions } from './types'; -import { getTimeStat } from './util.js'; import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from './plugins/util.js'; -import { extname } from 'node:path'; -import type { RouteData } from '../../@types/astro'; +import type { PageBuildData, StaticBuildOptions } from './types'; +import { getTimeStat } from './util.js'; export async function viteBuild(opts: StaticBuildOptions) { const { allPages, settings } = opts;