diff --git a/packages/astro/e2e/ts-resolution.test.js b/packages/astro/e2e/ts-resolution.test.js index 5fb729a5e..b1d1fcef6 100644 --- a/packages/astro/e2e/ts-resolution.test.js +++ b/packages/astro/e2e/ts-resolution.test.js @@ -30,11 +30,11 @@ test.describe('TypeScript resolution -', () => { const t = test.extend({}); let devServer; - + t.beforeEach(async ({ astro }) => { devServer = await astro.startDevServer(); }); - + t.afterEach(async () => { await devServer.stop(); }); @@ -49,16 +49,16 @@ test.describe('TypeScript resolution -', () => { t.beforeAll(async ({ astro }) => { await astro.build(); - }) - + }); + t.beforeEach(async ({ astro }) => { previewServer = await astro.preview(); }); - + t.afterEach(async () => { await previewServer.stop(); }); runTest(t); - }) + }); }); diff --git a/packages/astro/src/core/render/dev/resolve.ts b/packages/astro/src/core/render/dev/resolve.ts index a36ea2a4b..0103fa9c1 100644 --- a/packages/astro/src/core/render/dev/resolve.ts +++ b/packages/astro/src/core/render/dev/resolve.ts @@ -1,8 +1,7 @@ - export function resolveClientDevPath(id: string) { - if(id.startsWith('/@fs')) { + if (id.startsWith('/@fs')) { // Vite does not resolve .jsx -> .tsx when coming from the client, so clip the extension. - if(id.endsWith('.jsx')) { + if (id.endsWith('.jsx')) { return id.slice(0, id.length - 4); } } diff --git a/packages/astro/src/runtime/server/metadata.ts b/packages/astro/src/runtime/server/metadata.ts index 0cae29b63..c736820d2 100644 --- a/packages/astro/src/runtime/server/metadata.ts +++ b/packages/astro/src/runtime/server/metadata.ts @@ -37,10 +37,10 @@ export class Metadata { } resolvePath(specifier: string): string { - if(specifier.startsWith('.')) { + if (specifier.startsWith('.')) { const resolved = new URL(specifier, this.mockURL).pathname; // Vite does not resolve .jsx -> .tsx when coming from the client, so clip the extension. - if(resolved.startsWith('/@fs') && resolved.endsWith('.jsx')) { + if (resolved.startsWith('/@fs') && resolved.endsWith('.jsx')) { return resolved.slice(0, resolved.length - 4); } return resolved;