fix(nx/server): get images to work in dev mode

This commit is contained in:
Elian Doran 2025-04-24 12:35:53 +03:00
parent d2010872ac
commit 5911eaf6b2
No known key found for this signature in database
10 changed files with 4 additions and 14 deletions

View File

@ -17,9 +17,5 @@
"eslint.config.cjs",
"eslint.config.mjs"
],
"references": [
{
"path": "../server/tsconfig.app.json"
}
]
"references": []
}

View File

@ -3,9 +3,6 @@
"files": [],
"include": [],
"references": [
{
"path": "../server"
},
{
"path": "./tsconfig.app.json"
}

View File

Before

Width:  |  Height:  |  Size: 805 B

After

Width:  |  Height:  |  Size: 805 B

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -34,14 +34,15 @@ async function register(app: express.Application) {
app.use(`/${assetPath}/libraries`, proxy(publicUrl, {
proxyReqPathResolver: (req) => "/libraries" + req.url
}));
app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, "assets", "images")));
} else {
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}/stylesheets`, persistentCacheStatic(path.join(srcRoot, "public/stylesheets")));
app.use(`/${assetPath}/images`, persistentCacheStatic(path.join(srcRoot, "..", "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(`/${assetPath}/images`, persistentCacheStatic(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(`/${assetPath}/libraries`, persistentCacheStatic(path.join(srcRoot, "public/libraries")));

View File

@ -24,11 +24,7 @@ module.exports = {
{
from: "node_modules/better-sqlite3/build/Release",
to: join(outputDir, "Release")
},
{
from: "../client/dist",
to: join(outputDir, "app")
}
},
]
})
]