File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
create-template/templates/sveltekit-site Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,15 @@ export const dedupe = <T>(array: T[]): T[] => {
9
9
return Array . from ( new Set ( array ) ) ;
10
10
} ;
11
11
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
+ } ;
Original file line number Diff line number Diff line change 1
1
{
2
- "extends" : " ./.svelte-kit/tsconfig.json" ,
3
2
"compilerOptions" : {
4
3
"allowJs" : true ,
5
4
"checkJs" : true ,
You can’t perform that action at this time.
0 commit comments