fix: client:only behavior with a single renderer (#1959)
This commit is contained in:
parent
8775730eb9
commit
aec4e8da27
2 changed files with 9 additions and 0 deletions
5
.changeset/slimy-turtles-boil.md
Normal file
5
.changeset/slimy-turtles-boil.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix client:only behavior when only a single renderer is configured
|
|
@ -168,6 +168,10 @@ Did you mean to enable ${formatList(probableRendererNames.map((r) => '`' + r + '
|
|||
const rendererName = metadata.hydrateArgs;
|
||||
renderer = renderers.filter(({ name }) => name === `@astrojs/renderer-${rendererName}` || name === rendererName)[0];
|
||||
}
|
||||
// Attempt: user only has a single renderer, default to that
|
||||
if (!renderer && renderers.length === 1) {
|
||||
renderer = renderers[0]
|
||||
}
|
||||
// Attempt: can we guess the renderer from the export extension?
|
||||
if (!renderer) {
|
||||
const extname = metadata.componentUrl?.split('.').pop();
|
||||
|
|
Loading…
Reference in a new issue