Files
klz-cables.com/.pnpm-store/v10/files/4d/59d71346572573af0b3aa2ceddfa55e2e696a369f25e656efc776df01178dd2ed3109f6edacb82a1fa64ab93ae7b924f8eabbcf92961b8629d6cd3f5826183
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

86 lines
2.2 KiB
Plaintext

import * as path from 'path';
import { getPackageModules } from '../util.js';
/**
* Generate the value injection rules for client and server in turbopack config.
*/
function generateValueInjectionRules({
routeManifest,
nextJsVersion,
tunnelPath,
vercelCronsConfig,
}
) {
const rules = [];
const isomorphicValues = {};
let clientValues = {};
let serverValues = {};
if (nextJsVersion) {
// This is used to determine version-based dev-symbolication behavior
isomorphicValues._sentryNextJsVersion = nextJsVersion;
}
if (routeManifest) {
clientValues._sentryRouteManifest = JSON.stringify(routeManifest);
}
// Inject tunnel route path for both client and server
if (tunnelPath) {
isomorphicValues._sentryRewritesTunnelPath = tunnelPath;
}
// Inject Vercel crons config for server-side cron auto-instrumentation
if (vercelCronsConfig) {
serverValues._sentryVercelCronsConfig = JSON.stringify(vercelCronsConfig);
}
// Inject server modules (matching webpack's __SENTRY_SERVER_MODULES__ behavior)
// Use process.cwd() to get the project directory at build time
serverValues.__SENTRY_SERVER_MODULES__ = getPackageModules(process.cwd());
if (Object.keys(isomorphicValues).length > 0) {
clientValues = { ...clientValues, ...isomorphicValues };
serverValues = { ...serverValues, ...isomorphicValues };
}
// Client value injection
if (Object.keys(clientValues).length > 0) {
rules.push({
matcher: '**/instrumentation-client.*',
rule: {
loaders: [
{
loader: path.resolve(__dirname, '..', 'loaders', 'valueInjectionLoader.js'),
options: {
values: clientValues,
},
},
],
},
});
}
// Server value injection
if (Object.keys(serverValues).length > 0) {
rules.push({
matcher: '**/instrumentation.*',
rule: {
loaders: [
{
loader: path.resolve(__dirname, '..', 'loaders', 'valueInjectionLoader.js'),
options: {
values: serverValues,
},
},
],
},
});
}
return rules;
}
export { generateValueInjectionRules };
//# sourceMappingURL=generateValueInjectionRules.js.map