Skip to content

Commit

Permalink
fix(#4194): remove Astro runtime from browser (#4282)
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Moore <nate@astro.build>
  • Loading branch information
natemoo-re and natemoo-re committed Aug 12, 2022
1 parent b0033ce commit c0992e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/heavy-nails-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix bug where Astro's server runtime would end up in the browser
5 changes: 4 additions & 1 deletion packages/astro/src/vite-plugin-jsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c0992e1

Please sign in to comment.