fix(nx/docker): client-side translations

This commit is contained in:
Elian Doran 2025-04-25 14:06:33 +03:00
parent d8ee579204
commit 69f854034f
No known key found for this signature in database
10 changed files with 6 additions and 4 deletions

View File

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

View File

@ -39,6 +39,9 @@ async function register(app: express.Application) {
app.use(`/${assetPath}/fonts`, proxy(publicUrl, {
proxyReqPathResolver: (req) => "/fonts" + req.url
}));
app.use(`/${assetPath}/translations`, proxy(publicUrl, {
proxyReqPathResolver: (req) => "/translations" + req.url
}));
app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, "assets", "images")));
} else {
const clientStaticCache = persistentCacheStatic(path.join(resourceDir, "public"));
@ -47,6 +50,7 @@ async function register(app: express.Application) {
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}/translations/`, persistentCacheStatic(path.join(resourceDir, "public", "translations")));
app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(resourceDir, "assets", "images")));
}
app.use(`/assets/vX/fonts`, express.static(path.join(srcRoot, "public/fonts")));
@ -75,9 +79,6 @@ async function register(app: express.Application) {
app.use(`/${assetPath}/node_modules/jquery-hotkeys/`, persistentCacheStatic(path.join(nodeModulesDir, "jquery-hotkeys/")));
// i18n
app.use(`/${assetPath}/translations/`, persistentCacheStatic(path.join(srcRoot, "public", "translations/")));
// Deprecated, https://www.npmjs.com/package/autocomplete.js?activeTab=readme
app.use(`/${assetPath}/node_modules/autocomplete.js/dist/`, persistentCacheStatic(path.join(nodeModulesDir, "autocomplete.js/dist/")));