
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
postcss-fontsource-url
Advanced tools
PostCSS plugin that transforms @fontsource src CSS properties values
to point URLs to your own custom directory.
npm add --save-dev postcss-fontsource-url
Move the @fontsource fonts to your public directory:
📁 dist
└── 📁 assets
└── 📁 fonts
├── roboto-mono-latin-400-normal.woff
└── roboto-mono-latin-400-normal.woff2
/* stylesheet.css */
@import '@fontsource/roboto-mono/400.css';
// postcss.config.mjs
import postcssFontsourceUrl from 'postcss-fontsource-url';
export default {
plugins: {
postcssFontsourceUrl({directory: '/assets/fonts'}),
},
};
If you want a more complex solution for the problem, you can use postcss-url:
// postcss.config.mjs
import postcssUrl from 'postcss-url';
export default {
plugins: {
postcssUrl({
url(asset) {
// Rewrite @fontsource fonts URLs to use the `/assets/fonts` folder
// instead of the default `./files/` path.
if (asset.url.startsWith('./files/')) {
return `/assets/fonts/${asset.url.slice('./files/'.length)}`;
}
return asset.url;
},
}),
},
};
FAQs
PostCSS plugin to rewrite @fontsource CSS URLs
The npm package postcss-fontsource-url receives a total of 6 weekly downloads. As such, postcss-fontsource-url popularity was classified as not popular.
We found that postcss-fontsource-url demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.