From 1bc5b7b8bc10b66a49abf4d3d7c4d1a0350ab47b Mon Sep 17 00:00:00 2001 From: "Fred K. Schott" Date: Mon, 13 Dec 2021 13:41:06 -0800 Subject: [PATCH] parse all documents as fragments now --- packages/astro/src/vite-plugin-astro/index.ts | 2 +- packages/astro/src/vite-plugin-markdown/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index e77389ff6..609d0de10 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -57,7 +57,7 @@ export default function astro({ config, devServer }: AstroPluginOptions): vite.P // use `sourcemap: "both"` so that sourcemap is included in the code // result passed to esbuild, but also available in the catch handler. tsResult = await transform(source, { - as: isPage ? 'document' : 'fragment', + as: 'fragment', projectRoot: config.projectRoot.toString(), site: config.buildOptions.site, sourcefile: id, diff --git a/packages/astro/src/vite-plugin-markdown/index.ts b/packages/astro/src/vite-plugin-markdown/index.ts index 0d868a7cd..e5a41597d 100644 --- a/packages/astro/src/vite-plugin-markdown/index.ts +++ b/packages/astro/src/vite-plugin-markdown/index.ts @@ -53,6 +53,7 @@ ${setup}`.trim(); // Transform from `.astro` to valid `.ts` let { code: tsResult } = await transform(astroResult, { + as: 'fragment', projectRoot: config.projectRoot.toString(), site: config.buildOptions.site, sourcefile: id,