@@ -96,7 +96,7 @@ export async function emitAssets(
96
96
const [ filePath , idRef ] = url . url . split ( '#' ) ;
97
97
98
98
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
100
100
const assetLocation = path . resolve ( path . dirname ( asset . filePath ) , filePath ) ;
101
101
const assetContent = fs . readFileSync ( assetLocation ) ;
102
102
@@ -107,16 +107,16 @@ export async function emitAssets(
107
107
name : path . join ( 'assets' , path . basename ( filePath ) ) ,
108
108
source : assetContent ,
109
109
} ) ;
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
113
113
url . url = `assets/${
114
- idRef ? `${ emittedFontFilePath } #${ idRef } ` : emittedFontFilePath
114
+ idRef ? `${ emittedAssetFilePath } #${ idRef } ` : emittedAssetFilePath
115
115
} `;
116
116
} else {
117
- const emittedFontFilePath = emittedExternalAssets . get ( assetLocation ) ;
117
+ const emittedAssetFilePath = emittedExternalAssets . get ( assetLocation ) ;
118
118
url . url = `assets/${
119
- idRef ? `${ emittedFontFilePath } #${ idRef } ` : emittedFontFilePath
119
+ idRef ? `${ emittedAssetFilePath } #${ idRef } ` : emittedAssetFilePath
120
120
} `;
121
121
}
122
122
}
0 commit comments