Skip to content

Commit

Permalink
remove SSR resolve workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Apr 14, 2023
1 parent 568341e commit 2b2cdb8
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions packages/vite-plugin-svelte/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,24 +135,6 @@ export function svelte(inlineOptions?: Partial<Options>): Plugin[] {
}
}

if (ssr && importee === 'svelte') {
if (!resolvedSvelteSSR) {
resolvedSvelteSSR = this.resolve('svelte/ssr', undefined, { skipSelf: true }).then(
(svelteSSR) => {
log.debug('resolved svelte to svelte/ssr');
return svelteSSR;
},
(err) => {
log.debug(
'failed to resolve svelte to svelte/ssr. Update svelte to a version that exports it',
err
);
return null; // returning null here leads to svelte getting resolved regularly
}
);
}
return resolvedSvelteSSR;
}
//@ts-expect-error scan
const scan = !!opts?.scan; // scanner phase of optimizeDeps
const isPrebundled =
Expand Down

0 comments on commit 2b2cdb8

Please sign in to comment.