fix(monorepo/{client,server}): loading of fonts

This commit is contained in:
Elian Doran 2025-04-24 22:36:10 +03:00
parent 7935b250d0
commit be79eb41da
No known key found for this signature in database
10 changed files with 6 additions and 2 deletions

View File

@ -7,7 +7,7 @@
@font-face {
font-family: "Inter";
src: url(../../fonts/Inter/Inter-VariableFont_opsz\,wght.ttf);
src: url(../../fonts/Inter/Inter-VariableFont_opsz,wght.ttf);
}
/*

View File

@ -56,6 +56,7 @@ module.exports = {
"./src/assets",
"./src/stylesheets",
"./src/libraries",
"./src/fonts"
],
styles: [],
stylePreprocessorOptions: {

View File

@ -36,6 +36,9 @@ async function register(app: express.Application) {
app.use(`/${assetPath}/libraries`, proxy(publicUrl, {
proxyReqPathResolver: (req) => "/libraries" + req.url
}));
app.use(`/${assetPath}/fonts`, proxy(publicUrl, {
proxyReqPathResolver: (req) => "/fonts" + req.url
}));
app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, "assets", "images")));
} else {
const clientStaticCache = persistentCacheStatic(path.join(resourceDir, "public"));
@ -43,9 +46,9 @@ async function register(app: express.Application) {
app.use(`/${assetPath}/app-dist`, clientStaticCache);
app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(resourceDir, "public", "stylesheets")));
app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(resourceDir, "public", "libraries")));
app.use(`/${assetPath}/fonts`, persistentCacheStatic(path.join(resourceDir, "public", "fonts")));
app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(resourceDir, "assets", "images")));
}
app.use(`/${assetPath}/fonts`, persistentCacheStatic(path.join(srcRoot, "public/fonts")));
app.use(`/assets/vX/fonts`, express.static(path.join(srcRoot, "public/fonts")));
app.use(`/assets/vX/images`, express.static(path.join(srcRoot, "..", "images")));
app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, "public/stylesheets")));