[ci] format

This commit is contained in:
matthewp 2022-06-21 16:36:57 +00:00 committed by github-actions[bot]
parent c20b93c484
commit 0d3a7de527
3 changed files with 10 additions and 11 deletions

View file

@ -49,7 +49,7 @@ test.describe('TypeScript resolution -', () => {
t.beforeAll(async ({ astro }) => { t.beforeAll(async ({ astro }) => {
await astro.build(); await astro.build();
}) });
t.beforeEach(async ({ astro }) => { t.beforeEach(async ({ astro }) => {
previewServer = await astro.preview(); previewServer = await astro.preview();
@ -60,5 +60,5 @@ test.describe('TypeScript resolution -', () => {
}); });
runTest(t); runTest(t);
}) });
}); });

View file

@ -1,8 +1,7 @@
export function resolveClientDevPath(id: string) { 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. // 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); return id.slice(0, id.length - 4);
} }
} }

View file

@ -37,10 +37,10 @@ export class Metadata {
} }
resolvePath(specifier: string): string { resolvePath(specifier: string): string {
if(specifier.startsWith('.')) { if (specifier.startsWith('.')) {
const resolved = new URL(specifier, this.mockURL).pathname; const resolved = new URL(specifier, this.mockURL).pathname;
// Vite does not resolve .jsx -> .tsx when coming from the client, so clip the extension. // 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.slice(0, resolved.length - 4);
} }
return resolved; return resolved;