Skip to content

Commit 05bd48d

Browse files
committed
Fix sveltekit test #1094
1 parent 66ec212 commit 05bd48d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

browser/cli/src/utils.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ export const dedupe = <T>(array: T[]): T[] => {
99
return Array.from(new Set(array));
1010
};
1111

12-
export const getExtension = () =>
13-
getTsconfig()?.config.compilerOptions?.moduleResolution === 'Bundler'
14-
? ''
15-
: '.js';
12+
export const getExtension = () => {
13+
try {
14+
const tsconfig = getTsconfig();
15+
if (!tsconfig) return '.js';
16+
const moduleResolution = tsconfig.config.compilerOptions?.moduleResolution;
17+
if (!moduleResolution) return '.js';
18+
return moduleResolution === 'Bundler' ? '' : '.js';
19+
} catch (error) {
20+
console.error('Error getting extension:', error);
21+
return '.js';
22+
}
23+
};

browser/create-template/templates/sveltekit-site/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"extends": "./.svelte-kit/tsconfig.json",
32
"compilerOptions": {
43
"allowJs": true,
54
"checkJs": true,

0 commit comments

Comments
 (0)