From 1de419034d7863d7a8778981b080889402ba071c Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Mon, 6 Mar 2023 10:08:13 -0500 Subject: [PATCH] nit: move shiki highlighter consts to outer scope --- packages/astro/src/core/errors/dev/vite.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/astro/src/core/errors/dev/vite.ts b/packages/astro/src/core/errors/dev/vite.ts index 5d28ad5f8..1ae467c2c 100644 --- a/packages/astro/src/core/errors/dev/vite.ts +++ b/packages/astro/src/core/errors/dev/vite.ts @@ -122,6 +122,10 @@ export interface AstroErrorPayload { }; } +// Shiki does not support `mjs` or `cjs` aliases by default. +// Map these to `.js` during error highlighting. +const ALTERNATIVE_JS_EXTS = ['cjs', 'mjs']; + /** * Generate a payload for Vite's error overlay */ @@ -151,9 +155,7 @@ export async function getViteErrorPayload(err: ErrorWithMetadata): Promise