diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index f2bcdce23..d37fb48ac 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -113,7 +113,7 @@ async function clientBuild(opts: StaticBuildOptions, internals: BuildInternals, const { astroConfig, viteConfig } = opts; // Nothing to do if there is no client-side JS. - if(!input.size) { + if (!input.size) { return null; } @@ -265,15 +265,17 @@ export function vitePluginNewBuild(input: Set, internals: BuildInternals config(config, options) { const extra: Partial = {}; - const noExternal = [], external = []; - if(options.command === 'build' && config.build?.ssr) { + const noExternal = [], + external = []; + if (options.command === 'build' && config.build?.ssr) { noExternal.push('astro'); external.push('shiki'); } // @ts-ignore extra.ssr = { - external, noExternal + external, + noExternal, }; return extra; }, diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index 45bd42b8b..2c1b9693d 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -37,7 +37,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu let { filename, query } = parseAstroRequest(id); if (query.astro) { if (query.type === 'style') { - if(filename.startsWith('/@fs')) { + if (filename.startsWith('/@fs')) { filename = filename.slice('/@fs'.length); } else if (filename.startsWith('/') && !ancestor(filename, config.projectRoot.pathname)) { filename = new URL('.' + filename, config.projectRoot).pathname; diff --git a/packages/astro/test/static-build-code-component.test.js b/packages/astro/test/static-build-code-component.test.js index 4bf84de7e..c81a686e4 100644 --- a/packages/astro/test/static-build-code-component.test.js +++ b/packages/astro/test/static-build-code-component.test.js @@ -5,14 +5,13 @@ import { loadFixture } from './test-utils.js'; describe('Code component inside static build', () => { let fixture; - before(async () => { fixture = await loadFixture({ projectRoot: './fixtures/static-build-code-component/', renderers: [], buildOptions: { experimentalStaticBuild: true, - } + }, }); await fixture.build(); });