Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Nate Moore
168be188ca feat: remove "as" param 2022-01-20 14:25:16 -06:00

View file

@ -30,8 +30,6 @@ async function compile(config: AstroConfig, filename: string, source: string, vi
// pages and layouts should be transformed as full documents (implicit <head> <body> etc)
// everything else is treated as a fragment
const filenameURL = new URL(`file://${filename}`);
const normalizedID = fileURLToPath(filenameURL);
const isPage = normalizedID.startsWith(fileURLToPath(config.pages)) || normalizedID.startsWith(fileURLToPath(config.layouts));
const pathname = filenameURL.pathname.substr(config.projectRoot.pathname.length - 1);
let cssTransformError: Error | undefined;
@ -40,7 +38,6 @@ async function compile(config: AstroConfig, filename: string, source: string, vi
// use `sourcemap: "both"` so that sourcemap is included in the code
// result passed to esbuild, but also available in the catch handler.
const transformResult = await transform(source, {
as: isPage ? 'document' : 'fragment',
pathname,
projectRoot: config.projectRoot.toString(),
site: config.buildOptions.site,