From b78e7f3adabd5ad6ef2cfa1d7b5d8aa4d37406d6 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Mon, 6 Nov 2023 11:35:22 +0100 Subject: [PATCH] handle the cjs case for 5, too --- packages/language-server/src/importPackage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/language-server/src/importPackage.ts b/packages/language-server/src/importPackage.ts index defa2f1a5..b51c23a3b 100644 --- a/packages/language-server/src/importPackage.ts +++ b/packages/language-server/src/importPackage.ts @@ -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 {