Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { join } from 'path'

// Read version from package.json at startup. Using readFileSync since this
// runs once at import time, not per-request.
// Use process.cwd() instead of __dirname since bundlers like tsup change
// __dirname resolution, but cwd is reliably /app in Docker.
const pkg = JSON.parse(
readFileSync(join(__dirname, '../package.json'), 'utf-8')
readFileSync(join(process.cwd(), 'package.json'), 'utf-8')
)

export const version: string = pkg.version
Loading