fix(astro): correctly change configuration when node adapter is added (#6333)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
parent
3b1871a726
commit
63dda6dedd
2 changed files with 20 additions and 1 deletions
5
.changeset/swift-islands-promise.md
Normal file
5
.changeset/swift-islands-promise.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Correctly emit mode when passing `node` to the command `astro add`
|
|
@ -457,7 +457,21 @@ async function setAdapter(ast: t.File, adapter: IntegrationInfo, exportName: str
|
|||
return false;
|
||||
}) as t.ObjectProperty | undefined;
|
||||
|
||||
const adapterCall = t.callExpression(adapterId, []);
|
||||
let adapterCall;
|
||||
switch (adapter.id) {
|
||||
// the node adapter requires a mode
|
||||
case 'node': {
|
||||
adapterCall = t.callExpression(adapterId, [
|
||||
t.objectExpression([
|
||||
t.objectProperty(t.identifier('mode'), t.stringLiteral('standalone')),
|
||||
]),
|
||||
]);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
adapterCall = t.callExpression(adapterId, []);
|
||||
}
|
||||
}
|
||||
|
||||
if (!adapterProp) {
|
||||
configObject.properties.push(t.objectProperty(t.identifier('adapter'), adapterCall));
|
||||
|
|
Loading…
Reference in a new issue