Skip to content

Commit 0b8390f

Browse files
authored
Merge pull request #2669 from modernweb-dev/refactor/naming
refactor: var naming
2 parents c4a7712 + a742214 commit 0b8390f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/rollup-plugin-html/src/output/emitAssets.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)