File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { execSync } from 'child_process'
22
33export const getGitTag = ( ) => {
44 try {
5- return execSync ( 'git describe --abbrev=0 --tags' , { cwd : '.' } )
5+ return execSync ( 'git describe --abbrev=0 --tags' , { cwd : '.' , stdio : 'pipe' } )
66 . toString ( )
77 . replace ( / \r ? \n | \r / g, '' )
88 } catch ( error ) {
@@ -12,7 +12,7 @@ export const getGitTag = () => {
1212
1313export const getGitCommit = ( ) => {
1414 try {
15- return execSync ( 'git rev-parse --short HEAD' , { cwd : '.' } )
15+ return execSync ( 'git rev-parse --short HEAD' , { cwd : '.' , stdio : 'pipe' } )
1616 . toString ( )
1717 . trim ( )
1818 } catch ( error ) {
Original file line number Diff line number Diff line change @@ -19,7 +19,13 @@ import { sharedIgnoreErrors } from './config/sentry.js';
1919import { getGitCommit , getGitTag } from './scripts/utils.js' ;
2020
2121const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
22- const isProd = process . env . NODE_ENV === 'production' ;
22+
23+ // Detect production mode by the presence of the pre-built SSR entry point rather than
24+ // relying on NODE_ENV alone. Review/staging environments may set NODE_ENV to a
25+ // non-"production" value (e.g. "staging") while still running the production image,
26+ // which does not include src/ and cannot serve via Vite dev middleware.
27+ const builtEntryPath = path . join ( __dirname , 'dist/server/server-entry.mjs' ) ;
28+ const isProd = fs . existsSync ( builtEntryPath ) ;
2329
2430const GIT_TAG = getGitTag ( ) ;
2531const GIT_COMMIT = getGitCommit ( ) ;
You can’t perform that action at this time.
0 commit comments