Demo URL
No response
What happened?
There's an issue when using custom fonts with absolute src paths. The problem arises in the resolveFontFiles function, where the absolute root is joined with the absolute source, leading to incorrect path resolution. This prevents the plugin from loading custom fonts specified with absolute paths.
|
for (const source of sources) { |
|
const results = fg.sync(join(root, source), { absolute: true, cwd: root, onlyFiles: true }) |
Reproduction steps
Unfonts({
custom: {
families: [
{
name: 'Geist',
src: path.resolve(...), // any absolute path
},
],
injectTo: 'head',
},
});
Relevant log output
No error is thrown, the files are simply not found.
What browsers are you seeing the problem on?
Other
What is your operating system?
Windows