@@ -96,7 +96,7 @@ export async function emitAssets(
9696 const [ filePath , idRef ] = url . url . split ( '#' ) ;
9797
9898 if ( shouldHandleAsset ( filePath ) ) {
99- // Read the font file, get the font from the source location on the FS using asset.filePath
99+ // Read the asset file, get the asset from the source location on the FS using asset.filePath
100100 const assetLocation = path . resolve ( path . dirname ( asset . filePath ) , filePath ) ;
101101 const assetContent = fs . readFileSync ( assetLocation ) ;
102102
@@ -107,16 +107,16 @@ export async function emitAssets(
107107 name : path . join ( 'assets' , path . basename ( filePath ) ) ,
108108 source : assetContent ,
109109 } ) ;
110- const emittedFontFilePath = path . basename ( this . getFileName ( fontFileRef ) ) ;
111- emittedExternalAssets . set ( assetLocation , emittedFontFilePath ) ;
112- // Update the URL in the original CSS file to point to the emitted font file
110+ const emittedAssetFilePath = path . basename ( this . getFileName ( fontFileRef ) ) ;
111+ emittedExternalAssets . set ( assetLocation , emittedAssetFilePath ) ;
112+ // Update the URL in the original CSS file to point to the emitted asset file
113113 url . url = `assets/${
114- idRef ? `${ emittedFontFilePath } #${ idRef } ` : emittedFontFilePath
114+ idRef ? `${ emittedAssetFilePath } #${ idRef } ` : emittedAssetFilePath
115115 } `;
116116 } else {
117- const emittedFontFilePath = emittedExternalAssets . get ( assetLocation ) ;
117+ const emittedAssetFilePath = emittedExternalAssets . get ( assetLocation ) ;
118118 url . url = `assets/${
119- idRef ? `${ emittedFontFilePath } #${ idRef } ` : emittedFontFilePath
119+ idRef ? `${ emittedAssetFilePath } #${ idRef } ` : emittedAssetFilePath
120120 } `;
121121 }
122122 }
0 commit comments