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

Compile <script> tags as TypeScript rather than JS

This commit is contained in:
unknown 2022-05-12 18:29:22 -06:00
parent 8685506174
commit 5f52901fdf
3 changed files with 4 additions and 3 deletions

View file

@ -102,7 +102,7 @@ export class Metadata {
let i = 0,
pathname = metadata.mockURL.pathname;
while (i < metadata.hoisted.length) {
yield `${pathname}?astro&type=script&index=${i}`;
yield `${pathname}?astro&type=script&index=${i}&lang.ts`;
i++;
}
}

View file

@ -316,7 +316,6 @@ async function handleRequest(
return await writeSSRResult(result, res, statusCode);
}
} catch (_err) {
debugger;
const err = fixViteErrorMessage(createSafeError(_err), viteServer);
error(logging, null, msg.formatErrorMessage(err));
handle500Response(viteServer, origin, req, res, err);

View file

@ -1,3 +1,5 @@
<script>
console.log('some content here.');
type Foo = 'bar';
const thing: Foo = 'bar';
console.log('some content here.', thing);
</script>