File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
turbopack/crates/turbopack-ecmascript/src/references Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,17 @@ fn externals_fs_root() -> Vc<FileSystemPath> {
292292impl Module for CachedExternalModule {
293293 #[ turbo_tasks:: function]
294294 async fn ident ( & self ) -> Result < Vc < AssetIdent > > {
295- let mut ident = AssetIdent :: from_path ( externals_fs_root ( ) . await ?. join ( & self . request ) ?)
295+ // For script externals, simplify the path by using variable name
296+ // instead of the full url to avoid long filenames
297+ let path_str = if self . external_type == CachedExternalType :: Script
298+ && let Some ( at_index) = self . request . find ( '@' )
299+ {
300+ let variable_name = & self . request [ ..at_index] ;
301+ variable_name. to_string ( )
302+ } else {
303+ self . request . to_string ( )
304+ } ;
305+ let mut ident = AssetIdent :: from_path ( externals_fs_root ( ) . await ?. join ( & path_str) ?)
296306 . with_layer ( Layer :: new ( rcstr ! ( "external" ) ) )
297307 . with_modifier ( self . request . clone ( ) )
298308 . with_modifier ( self . external_type . to_string ( ) . into ( ) ) ;
You can’t perform that action at this time.
0 commit comments