@@ -38,7 +38,8 @@ def __init__(self, name: str, **config: str | bool):
3838 self .url : str = str (config .get ("url" , "" ))
3939 self .installed : str = str (config .get ("installed" , "" ))
4040 self .filename : str = str (config .get ("filename" , "" ))
41- self .sourcemap : str = str (config .get ("sourcemap" , "" ))
41+ # sourcemap can be bool (True/False) or str (custom filename)
42+ self .sourcemap : bool | str = config .get ("sourcemap" , False )
4243
4344 @staticmethod
4445 def parse_version_from_url (url : str ) -> str :
@@ -185,12 +186,12 @@ def vendor(self, response: requests.Response) -> Path:
185186
186187 # If a sourcemap is requested, download it as well
187188 if self .sourcemap :
188- if isinstance (self .sourcemap , str ):
189- # Use a specific filename from config
190- sourcemap_filename = self .sourcemap
191- else :
192- # Otherwise, append .map to the URL
189+ if self .sourcemap is True :
190+ # Default: append .map to the filename
193191 sourcemap_filename = f"{ filename } .map"
192+ else :
193+ # Use a specific filename from config
194+ sourcemap_filename = str (self .sourcemap )
194195
195196 sourcemap_url = "/" .join (
196197 response .url .split ("/" )[:- 1 ] + [sourcemap_filename ] # type: ignore
0 commit comments