Skip to content

Commit

Permalink
fix: fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernankez committed Mar 25, 2024
1 parent 0cdf63c commit aac6578
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const FontCarrier: (options: FontCarrierOptions) => Plugin = (options) => {
fs.outputFileSync(tempPath, compressedSource);
font.tempPath = tempPath;
}
font.hashname = font.underPublicDir ? `${font.filename}${font.outputExtname}` : join(resolvedConfig.build.assetsDir, `${font.filename}-${font.hash.slice(0, 8)}${font.outputExtname}`);
font.hashname = font.underPublicDir ? `${font.filename}${font.outputExtname}` : normalizePath(join(resolvedConfig.build.assetsDir, `${font.filename}-${font.hash.slice(0, 8)}${font.outputExtname}`));
font.compressed = true;
return font;
}
Expand Down Expand Up @@ -175,9 +175,9 @@ const FontCarrier: (options: FontCarrierOptions) => Plugin = (options) => {
for (const url of urls) {
let path: string;
if (isAbsolute(url)) {
path = normalizePath(resolve(resolvedConfig.publicDir, url.slice(1)));
path = resolve(resolvedConfig.publicDir, url.slice(1));
} else {
path = normalizePath(resolve(dirname(id), url));
path = resolve(dirname(id), url);
}
const font = fontAssets.find(font => font.path === path);
if (font) {
Expand Down

0 comments on commit aac6578

Please sign in to comment.