diff options
author | 2022-08-12 10:48:53 -0500 | |
---|---|---|
committer | 2022-08-12 10:48:53 -0500 | |
commit | c0992e1fefc105577e99ac94338d349dbabf38d8 (patch) | |
tree | 6e274ee8e0fba258620c21d0ee24ac88e8d52f6b | |
parent | b0033cef32f1e7ec83ae22d481e9c81125986309 (diff) | |
download | astro-c0992e1fefc105577e99ac94338d349dbabf38d8.tar.gz astro-c0992e1fefc105577e99ac94338d349dbabf38d8.tar.zst astro-c0992e1fefc105577e99ac94338d349dbabf38d8.zip |
fix(#4194): remove Astro runtime from browser (#4282)
Co-authored-by: Nate Moore <nate@astro.build>
Diffstat (limited to '')
-rw-r--r-- | .changeset/heavy-nails-juggle.md | 5 | ||||
-rw-r--r-- | packages/astro/src/vite-plugin-jsx/index.ts | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/.changeset/heavy-nails-juggle.md b/.changeset/heavy-nails-juggle.md new file mode 100644 index 000000000..068631f67 --- /dev/null +++ b/.changeset/heavy-nails-juggle.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix bug where Astro's server runtime would end up in the browser diff --git a/packages/astro/src/vite-plugin-jsx/index.ts b/packages/astro/src/vite-plugin-jsx/index.ts index 3a6f47e86..f8f65743c 100644 --- a/packages/astro/src/vite-plugin-jsx/index.ts +++ b/packages/astro/src/vite-plugin-jsx/index.ts @@ -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, |