summaryrefslogtreecommitdiff
path: root/packages/integrations/preact
diff options
context:
space:
mode:
authorGravatar Emanuele Stoppa <my.burning@gmail.com> 2023-08-10 11:49:52 +0100
committerGravatar Emanuele Stoppa <my.burning@gmail.com> 2023-08-10 11:49:52 +0100
commit14b0626f3eca8ec92df29b0d43b87cd2f59efa25 (patch)
treeffbb2499b12734de79309fb098c964a9ef22428b /packages/integrations/preact
parent08c3afb8606f7e0cde30db66c07782c6c058f182 (diff)
parent1e3c9f515b78dded044a2b1582cf629a15943f69 (diff)
downloadastro-14b0626f3eca8ec92df29b0d43b87cd2f59efa25.tar.gz
astro-14b0626f3eca8ec92df29b0d43b87cd2f59efa25.tar.zst
astro-14b0626f3eca8ec92df29b0d43b87cd2f59efa25.zip
Merge remote-tracking branch 'origin/main' into next
Diffstat (limited to 'packages/integrations/preact')
-rw-r--r--packages/integrations/preact/CHANGELOG.md6
-rw-r--r--packages/integrations/preact/src/index.ts14
2 files changed, 12 insertions, 8 deletions
diff --git a/packages/integrations/preact/CHANGELOG.md b/packages/integrations/preact/CHANGELOG.md
index e24312338..184d1914e 100644
--- a/packages/integrations/preact/CHANGELOG.md
+++ b/packages/integrations/preact/CHANGELOG.md
@@ -6,6 +6,12 @@
- [`1eae2e3f7`](https://github.com/withastro/astro/commit/1eae2e3f7d693c9dfe91c8ccfbe606d32bf2fb81) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.
+## 2.2.2
+
+### Patch Changes
+
+- [#8007](https://github.com/withastro/astro/pull/8007) [`58b121d42`](https://github.com/withastro/astro/commit/58b121d42a9f58a5a992f0c378b036f37e9715fc) Thanks [@paperdave](https://github.com/paperdave)! - Support Bun by adjusting how `@babel/plugin-transform-react-jsx` is imported.
+
## 2.2.1
### Patch Changes
diff --git a/packages/integrations/preact/src/index.ts b/packages/integrations/preact/src/index.ts
index 4f4b0ee79..98a2dd205 100644
--- a/packages/integrations/preact/src/index.ts
+++ b/packages/integrations/preact/src/index.ts
@@ -7,10 +7,9 @@ function getRenderer(development: boolean): AstroRenderer {
serverEntrypoint: '@astrojs/preact/server.js',
jsxImportSource: 'preact',
jsxTransformOptions: async () => {
- const {
- default: { default: jsx },
- // @ts-expect-error types not found
- } = await import('@babel/plugin-transform-react-jsx');
+ // @ts-expect-error types not found
+ const plugin = await import('@babel/plugin-transform-react-jsx');
+ const jsx = plugin.default?.default ?? plugin.default;
return {
plugins: [jsx({}, { runtime: 'automatic', importSource: 'preact' })],
};
@@ -25,10 +24,9 @@ function getCompatRenderer(development: boolean): AstroRenderer {
serverEntrypoint: '@astrojs/preact/server.js',
jsxImportSource: 'react',
jsxTransformOptions: async () => {
- const {
- default: { default: jsx },
- // @ts-expect-error types not found
- } = await import('@babel/plugin-transform-react-jsx');
+ // @ts-expect-error types not found
+ const plugin = await import('@babel/plugin-transform-react-jsx');
+ const jsx = plugin.default?.default ?? plugin.default;
return {
plugins: [
jsx({}, { runtime: 'automatic', importSource: 'preact/compat' }),