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

fix(#4194): remove Astro runtime from browser (#4282)

Co-authored-by: Nate Moore <nate@astro.build>
This commit is contained in:
Nate Moore 2022-08-12 10:48:53 -05:00 committed by GitHub
parent b0033cef32
commit c0992e1fef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix bug where Astro's server runtime would end up in the browser

View file

@ -56,7 +56,10 @@ async function transformJSX({
}: TransformJSXOptions): Promise<TransformResult> {
const { jsxTransformOptions } = renderer;
const options = await jsxTransformOptions!({ mode, ssr });
const plugins = [...(options.plugins || []), tagExportsPlugin({ rendererName: renderer.name })];
const plugins = [...(options.plugins || [])];
if (ssr) {
plugins.push(tagExportsPlugin({ rendererName: renderer.name }))
}
const result = await babel.transformAsync(code, {
presets: options.presets,
plugins,