summaryrefslogtreecommitdiff
path: root/packages/integrations/preact/src
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/src
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/src')
-rw-r--r--packages/integrations/preact/src/index.ts14
1 files changed, 6 insertions, 8 deletions
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' }),