fix(nx/client): proxying of libraries

This commit is contained in:
Elian Doran 2025-04-23 11:40:23 +03:00
parent b213f9940e
commit 44b778fde6
No known key found for this signature in database
12 changed files with 9 additions and 2 deletions

View File

@ -12,6 +12,7 @@ export async function initLocale() {
locales = await server.get<Locale[]>("options/locales"); locales = await server.get<Locale[]>("options/locales");
await i18next.use(i18nextHttpBackend).init({ await i18next.use(i18nextHttpBackend).init({
debug: true,
lng: locale, lng: locale,
fallbackLng: "en", fallbackLng: "en",
backend: { backend: {

View File

@ -42,7 +42,11 @@ module.exports = {
} }
], ],
baseHref: '/', baseHref: '/',
assets: ["./src/assets", "./src/stylesheets"], assets: [
"./src/assets",
"./src/stylesheets",
"./src/libraries",
],
styles: [], styles: [],
outputHashing: process.env['NODE_ENV'] === 'production' ? 'all' : 'none', outputHashing: process.env['NODE_ENV'] === 'production' ? 'all' : 'none',
optimization: process.env['NODE_ENV'] === 'production', optimization: process.env['NODE_ENV'] === 'production',

View File

@ -31,7 +31,9 @@ async function register(app: express.Application) {
app.use(`/${assetPath}/stylesheets`, proxy(publicUrl, { app.use(`/${assetPath}/stylesheets`, proxy(publicUrl, {
proxyReqPathResolver: (req) => "/stylesheets" + req.url proxyReqPathResolver: (req) => "/stylesheets" + req.url
})); }));
app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(srcRoot, "../../client/libraries"))); app.use(`/${assetPath}/libraries`, proxy(publicUrl, {
proxyReqPathResolver: (req) => "/libraries" + req.url
}));
} else { } else {
app.use(`/${assetPath}/app`, persistentCacheStatic(path.join(srcRoot, "public/app"))); app.use(`/${assetPath}/app`, persistentCacheStatic(path.join(srcRoot, "public/app")));
app.use(`/${assetPath}/app-dist`, persistentCacheStatic(path.join(srcRoot, "public/app-dist"))); app.use(`/${assetPath}/app-dist`, persistentCacheStatic(path.join(srcRoot, "public/app-dist")));