Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_fs = require('node:fs'); const node_path = require('node:path'); const ENV_FALLBACK_OPTIONS_FN = "() => undefined"; const OPTIONS_IMPORT_IDENTIFIER = "__SENTRY_OPTIONS_CALLBACK__"; const INSTRUMENT_FILE_BASENAME = "instrument.server"; const INSTRUMENT_FILE_EXTENSIONS = ["ts", "mts", "js", "mjs", "cjs"]; function resolveInstrumentFile(entryFilePath) { const dir = node_path.dirname(entryFilePath); for (const ext of INSTRUMENT_FILE_EXTENSIONS) { const candidate = node_path.resolve(dir, `${INSTRUMENT_FILE_BASENAME}.${ext}`); if (node_fs.existsSync(candidate)) return candidate; } return void 0; } function buildOptionsImport(entryFilePath, instrumentFilePath) { let relativePath = node_path.relative(node_path.dirname(entryFilePath), instrumentFilePath).replace(/\\/g, "/"); if (!relativePath.startsWith(".")) relativePath = `./${relativePath}`; return { optionsFn: OPTIONS_IMPORT_IDENTIFIER, importStmt: `import ${OPTIONS_IMPORT_IDENTIFIER} from '${relativePath}'; ` }; } exports.ENV_FALLBACK_OPTIONS_FN = ENV_FALLBACK_OPTIONS_FN; exports.buildOptionsImport = buildOptionsImport; exports.resolveInstrumentFile = resolveInstrumentFile; //# sourceMappingURL=instrumentFile.js.map