parse all documents as fragments now

This commit is contained in:
Fred K. Schott 2021-12-13 13:41:06 -08:00 committed by Jonathan Neal
parent b6398c4dbe
commit 1bc5b7b8bc
2 changed files with 2 additions and 1 deletions

View file

@ -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,

View file

@ -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,