@@ -215,7 +215,6 @@ async fn static_route_source(mode: NextMode, path: FileSystemPath) -> Result<Vc<
215215async fn dynamic_text_route_source ( path : FileSystemPath ) -> Result < Vc < Box < dyn Source > > > {
216216 let stem = path. file_stem ( ) ;
217217 let stem = stem. unwrap_or_default ( ) ;
218- let ext = path. extension ( ) ;
219218
220219 let content_type = get_content_type ( path. clone ( ) ) . await ?;
221220
@@ -250,7 +249,7 @@ async fn dynamic_text_route_source(path: FileSystemPath) -> Result<Vc<Box<dyn So
250249
251250 export * from {resource_path}
252251 "# ,
253- resource_path = StringifyJs ( & format!( "./{stem}.{ext}" ) ) ,
252+ resource_path = StringifyJs ( & format!( "./{}" , path . file_name ( ) ) ) ,
254253 content_type = StringifyJs ( & content_type) ,
255254 file_type = StringifyJs ( & stem) ,
256255 cache_control = StringifyJs ( CACHE_HEADER_REVALIDATE ) ,
@@ -270,7 +269,6 @@ async fn dynamic_sitemap_route_with_generate_source(
270269) -> Result < Vc < Box < dyn Source > > > {
271270 let stem = path. file_stem ( ) ;
272271 let stem = stem. unwrap_or_default ( ) ;
273- let ext = path. extension ( ) ;
274272 let content_type = get_content_type ( path. clone ( ) ) . await ?;
275273
276274 let code = formatdoc ! {
@@ -340,7 +338,7 @@ async fn dynamic_sitemap_route_with_generate_source(
340338 return params
341339 }}
342340 "# ,
343- resource_path = StringifyJs ( & format!( "./{stem}.{ext}" ) ) ,
341+ resource_path = StringifyJs ( & format!( "./{}" , path . file_name ( ) ) ) ,
344342 content_type = StringifyJs ( & content_type) ,
345343 file_type = StringifyJs ( & stem) ,
346344 cache_control = StringifyJs ( CACHE_HEADER_REVALIDATE ) ,
@@ -360,7 +358,6 @@ async fn dynamic_sitemap_route_without_generate_source(
360358) -> Result < Vc < Box < dyn Source > > > {
361359 let stem = path. file_stem ( ) ;
362360 let stem = stem. unwrap_or_default ( ) ;
363- let ext = path. extension ( ) ;
364361 let content_type = get_content_type ( path. clone ( ) ) . await ?;
365362
366363 let code = formatdoc ! {
@@ -391,7 +388,7 @@ async fn dynamic_sitemap_route_without_generate_source(
391388
392389 export * from {resource_path}
393390 "# ,
394- resource_path = StringifyJs ( & format!( "./{stem}.{ext}" ) ) ,
391+ resource_path = StringifyJs ( & format!( "./{}" , path . file_name ( ) ) ) ,
395392 content_type = StringifyJs ( & content_type) ,
396393 file_type = StringifyJs ( & stem) ,
397394 cache_control = StringifyJs ( CACHE_HEADER_REVALIDATE ) ,
@@ -423,7 +420,6 @@ async fn dynamic_image_route_with_metadata_source(
423420) -> Result < Vc < Box < dyn Source > > > {
424421 let stem = path. file_stem ( ) ;
425422 let stem = stem. unwrap_or_default ( ) ;
426- let ext = path. extension ( ) ;
427423
428424 let code = formatdoc ! {
429425 r#"
@@ -478,7 +474,7 @@ async fn dynamic_image_route_with_metadata_source(
478474 return staticParams
479475 }}
480476 "# ,
481- resource_path = StringifyJs ( & format!( "./{stem}.{ext}" ) ) ,
477+ resource_path = StringifyJs ( & format!( "./{}" , path . file_name ( ) ) ) ,
482478 } ;
483479
484480 let file = File :: from ( code) ;
@@ -495,7 +491,6 @@ async fn dynamic_image_route_without_metadata_source(
495491) -> Result < Vc < Box < dyn Source > > > {
496492 let stem = path. file_stem ( ) ;
497493 let stem = stem. unwrap_or_default ( ) ;
498- let ext = path. extension ( ) ;
499494
500495 let code = formatdoc ! {
501496 r#"
@@ -512,7 +507,7 @@ async fn dynamic_image_route_without_metadata_source(
512507
513508 export * from {resource_path}
514509 "# ,
515- resource_path = StringifyJs ( & format!( "./{stem}.{ext}" ) ) ,
510+ resource_path = StringifyJs ( & format!( "./{}" , path . file_name ( ) ) ) ,
516511 } ;
517512
518513 let file = File :: from ( code) ;
0 commit comments