Skip to content

Commit

Permalink
handle the cjs case for 5, too
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Nov 6, 2023
1 parent 3bb404b commit b78e7f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/language-server/src/importPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function importSvelte(fromPath: string): typeof svelte {
const pkg = getPackageInfo('svelte', fromPath);
const main = resolve(pkg.path, 'compiler');
Logger.debug('Using Svelte v' + pkg.version.full, 'from', main);
return dynamicRequire(main + (pkg.version.major === 4 ? '.cjs' : ''));
return dynamicRequire(main + (pkg.version.major >= 4 ? '.cjs' : ''));
}

export function importSveltePreprocess(fromPath: string): typeof sveltePreprocess {
Expand Down

0 comments on commit b78e7f3

Please sign in to comment.