Skip to content

Commit

Permalink
fix sveltekit-adapter addon
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel3108 committed Feb 9, 2025
1 parent 4216131 commit a37ab52
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/addons/sveltekit-adapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export default defineAddon({
if (adapterImportDecl) {
// replaces the import's source with the new adapter
adapterImportDecl.source.value = adapter.package;
// reset raw value, so that the string is re-generated
adapterImportDecl.source.raw = undefined;

adapterName = adapterImportDecl.specifiers?.find((s) => s.type === 'ImportDefaultSpecifier')
?.local?.name as string;
} else {
Expand All @@ -86,8 +89,7 @@ export default defineAddon({
(p) => p.type === 'Property' && p.key.type === 'Identifier' && p.key.name === 'adapter'
);
if (adapterProp) {
// @ts-expect-error comment nodes unknown in estree
adapterProp.comments = [];
adapterProp.leadingComments = [];
}

// only overrides the `adapter` property so we can reset it's args
Expand Down

0 comments on commit a37ab52

Please sign in to comment.