ssr
Gitea Actions Demo / build_and_push (push) Successful in 51s
Details
Gitea Actions Demo / build_and_push (push) Successful in 51s
Details
This commit is contained in:
parent
115bbae1ee
commit
3500acf253
|
|
@ -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;'"]
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue