@@ -89,15 +89,15 @@ export function CrossoutDirectory(path: string)
89
89
90
90
export function ComposeFile ( source : string )
91
91
{
92
- if ( source . endsWith ( ".svelte .tsx" ) )
92
+ if ( source . endsWith ( ".js .tsx" ) || source . endsWith ( ".ts ") )
93
93
{
94
- const component = TranscribeSvelteDraftSync ( source ) ;
95
- outputFileSync ( source . replace ( ". tsx", "" ) , component , "utf8" ) ;
94
+ const code = TranscribeTypeDraftSync ( source ) ;
95
+ outputFileSync ( source . replace ( source . endsWith ( ".js. tsx") ? ".js.tsx" : ".ts" , ".js " ) , code , "utf8" ) ;
96
96
}
97
- else if ( source . endsWith ( ".js. tsx" ) )
97
+ else if ( source . endsWith ( ".tsx" ) )
98
98
{
99
- const code = TranscribeTypeDraftSync ( source ) ;
100
- outputFileSync ( source . replace ( ".tsx" , "" ) , code , "utf8" ) ;
99
+ const component = TranscribeSvelteDraftSync ( source ) ;
100
+ outputFileSync ( source . replace ( ".tsx" , ".svelte " ) , component , "utf8" ) ;
101
101
}
102
102
}
103
103
@@ -142,8 +142,8 @@ export async function TranscribeSvelteDraftAsync(source: string)
142
142
const { import_section, script_section, template_section, module_context } = Transcribe ( code ) ;
143
143
144
144
//
145
- const style = source . replace ( ".svelte .tsx" , ".css" ) ;
146
- const style_section = await pathExists ( style ) ? await readFile ( style , "utf8" ) : "" ;
145
+ const style_path = source . replace ( ".tsx" , ".css" ) ;
146
+ const style_section = await pathExists ( style_path ) ? await readFile ( style_path , "utf8" ) : "" ;
147
147
148
148
//
149
149
const component = AssembleComponent ( import_section , script_section , template_section , style_section , module_context ) ;
@@ -157,7 +157,7 @@ export function TranscribeSvelteDraftSync(source: string)
157
157
const { import_section, script_section, template_section, module_context } = Transcribe ( code ) ;
158
158
159
159
//
160
- const style = source . replace ( ".svelte. tsx" , ".css" ) ;
160
+ const style = source . replace ( ".tsx" , ".css" ) ;
161
161
const style_section = existsSync ( style ) ? readFileSync ( style , "utf8" ) : "" ;
162
162
163
163
//
0 commit comments