summaryrefslogtreecommitdiff
path: root/packages/integrations/vue/src
diff options
context:
space:
mode:
authorGravatar Louis Escher <66965600+louisescher@users.noreply.github.com> 2025-01-14 12:52:51 +0100
committerGravatar GitHub <noreply@github.com> 2025-01-14 11:52:51 +0000
commitea603aec80531205d38fed11c525b3faa0271903 (patch)
tree12065af3d9a4a7c75e06df54fc12a9fb70be1367 /packages/integrations/vue/src
parentc30070b9271e4c494e7cbf3a1c45515782034911 (diff)
downloadastro-ea603aec80531205d38fed11c525b3faa0271903.tar.gz
astro-ea603aec80531205d38fed11c525b3faa0271903.tar.zst
astro-ea603aec80531205d38fed11c525b3faa0271903.zip
Add warnings if multiple JSX renderers are used (#12887)
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev> Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
Diffstat (limited to 'packages/integrations/vue/src')
-rw-r--r--packages/integrations/vue/src/index.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/integrations/vue/src/index.ts b/packages/integrations/vue/src/index.ts
index d9e42a6dd..2c7992fe8 100644
--- a/packages/integrations/vue/src/index.ts
+++ b/packages/integrations/vue/src/index.ts
@@ -158,6 +158,17 @@ export default function (options?: Options): AstroIntegration {
}
updateConfig({ vite: await getViteConfiguration(command, options) });
},
+ 'astro:config:done': ({ logger, config }) => {
+ if (!options?.jsx) return;
+
+ const knownJsxRenderers = ['@astrojs/react', '@astrojs/preact', '@astrojs/solid-js'];
+ const enabledKnownJsxRenderers = config.integrations.filter((renderer) => knownJsxRenderers.includes(renderer.name));
+
+ // This error can only be thrown from here since Vue is an optional JSX renderer
+ if (enabledKnownJsxRenderers.length > 1 && !options?.include && !options?.exclude) {
+ logger.warn('More than one JSX renderer is enabled. This will lead to unexpected behavior unless you set the `include` or `exclude` option. See https://docs.astro.build/en/guides/integrations-guide/solid-js/#combining-multiple-jsx-frameworks for more information.');
+ }
+ }
},
};
}