unplugin-fonts icon indicating copy to clipboard operation
unplugin-fonts copied to clipboard

[Bug]: Fontsource loader writes wrong path

Open luastoned opened this issue 1 year ago • 0 comments

Hello,

these two cases push an additional / breaking import statement.

https://github.com/cssninjaStudio/unplugin-fonts/blob/a7e66d594e2c7e0a2cccfed7c15a069ffebb96c1/src/loaders/fontsource.ts#L66-L71

The build step then breaks:

transforming (1) index.htmlUnable to resolve `@import "import '@fontsource-variable/open-sans/standard.css';"` from /undebug
✓ 4 modules transformed.
x Build failed in 84ms
error during build:
Error: [vite:css] [postcss] ENOENT: no such file or directory, open 'import '@fontsource-variable/open-sans/standard.css';'
file: unfonts.css:undefined:NaN

The logic for variable is also odd, it does not matter if opsz is true or false, simply being there has unintended side effects.

luastoned avatar Apr 26 '24 14:04 luastoned