Skip to content

Commit d3c7044

Browse files
authored
(fix) add .cjs ending for version 4
somehow require doesn't find svelte/compile else
1 parent 581efeb commit d3c7044

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/language-server/src/importPackage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function importSvelte(fromPath: string): typeof svelte {
5858
const pkg = getPackageInfo('svelte', fromPath);
5959
const main = resolve(pkg.path, 'compiler');
6060
Logger.debug('Using Svelte v' + pkg.version.full, 'from', main);
61-
return dynamicRequire(main);
61+
return dynamicRequire(main + (pkg.version.major === 4 ? '.cjs' : ''));
6262
}
6363

6464
export function importSveltePreprocess(fromPath: string): typeof sveltePreprocess {

0 commit comments

Comments
 (0)