ssr
Gitea Actions Demo / build_and_push (push) Successful in 51s Details

This commit is contained in:
artem 2026-09-18 23:48:40 +03:00
parent 115bbae1ee
commit 3500acf253
2 changed files with 4 additions and 1 deletions

View File

@ -31,4 +31,6 @@ RUN rm -f /etc/nginx/conf.d/default.conf
EXPOSE 80
ENV DIST_PATH=/usr/share/nginx/html
CMD ["sh", "-c", "npx tsx server/index.ts & nginx -g 'daemon off;'"]

View File

@ -20,7 +20,8 @@ export interface TemplateOptions {
* This ensures we always reference the correct hashed asset filenames.
*/
export function getAssetTags(): string {
const distIndex = path.resolve(__dirname, "../dist/index.html");
const distPath = process.env.DIST_PATH || path.resolve(__dirname, "../dist");
const distIndex = path.join(distPath, "index.html");
const html = fs.readFileSync(distIndex, "utf-8");
const scriptMatch = html.match(/<script[^>]*src="[^"]*"[^>]*><\/script>/g);
const linkMatch = html.match(/<link[^>]*rel="stylesheet"[^>]*>/g);