mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-11 11:02:27 +08:00
fix(monorepo/{client,server}): loading of fonts
This commit is contained in:
parent
7935b250d0
commit
be79eb41da
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Inter";
|
font-family: "Inter";
|
||||||
src: url(../../fonts/Inter/Inter-VariableFont_opsz\,wght.ttf);
|
src: url(../../fonts/Inter/Inter-VariableFont_opsz,wght.ttf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -56,6 +56,7 @@ module.exports = {
|
|||||||
"./src/assets",
|
"./src/assets",
|
||||||
"./src/stylesheets",
|
"./src/stylesheets",
|
||||||
"./src/libraries",
|
"./src/libraries",
|
||||||
|
"./src/fonts"
|
||||||
],
|
],
|
||||||
styles: [],
|
styles: [],
|
||||||
stylePreprocessorOptions: {
|
stylePreprocessorOptions: {
|
||||||
|
@ -36,6 +36,9 @@ async function register(app: express.Application) {
|
|||||||
app.use(`/${assetPath}/libraries`, proxy(publicUrl, {
|
app.use(`/${assetPath}/libraries`, proxy(publicUrl, {
|
||||||
proxyReqPathResolver: (req) => "/libraries" + req.url
|
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")));
|
app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, "assets", "images")));
|
||||||
} else {
|
} else {
|
||||||
const clientStaticCache = persistentCacheStatic(path.join(resourceDir, "public"));
|
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}/app-dist`, clientStaticCache);
|
||||||
app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(resourceDir, "public", "stylesheets")));
|
app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(resourceDir, "public", "stylesheets")));
|
||||||
app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(resourceDir, "public", "libraries")));
|
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}/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/fonts`, express.static(path.join(srcRoot, "public/fonts")));
|
||||||
app.use(`/assets/vX/images`, express.static(path.join(srcRoot, "..", "images")));
|
app.use(`/assets/vX/images`, express.static(path.join(srcRoot, "..", "images")));
|
||||||
app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, "public/stylesheets")));
|
app.use(`/assets/vX/stylesheets`, express.static(path.join(srcRoot, "public/stylesheets")));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user