@sentry/node
Version:
Sentry Node SDK using OpenTelemetry for performance instrumentation
32 lines (31 loc) • 1.28 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
let _sentry_bundler_plugins_esbuild = require("@sentry/bundler-plugins/esbuild");
let _sentry_server_utils_orchestrion_esbuild = require("@sentry/server-utils/orchestrion/esbuild");
// src/bundler-plugin/esbuild.ts
/**
* esbuild plugin that bundles the Sentry esbuild bundler plugin (source maps,
* release injection, …) together with the code transformer
* (build-time `diagnostics_channel` instrumentation for Node libraries).
*
* It is a drop-in replacement for `@sentry/bundler-plugins/esbuild` and accepts
* the same options.
* @example
* ```ts
* // build.mjs
* import { sentryEsbuildPlugin } from '@sentry/node/esbuild';
* await esbuild.build({ plugins: [sentryEsbuildPlugin({ org: '…', project: '…' })] });
* ```
*/
function sentryEsbuildPlugin(options) {
const bundlerPlugin = (0, _sentry_bundler_plugins_esbuild.sentryEsbuildPlugin)(options);
const orchestrionPlugin = (0, _sentry_server_utils_orchestrion_esbuild.sentryOrchestrionPlugin)(options);
return {
name: "sentry-node-esbuild",
async setup(build) {
await bundlerPlugin.setup(build);
await orchestrionPlugin.setup(build);
}
};
}
exports.sentryEsbuildPlugin = sentryEsbuildPlugin;
//# sourceMappingURL=esbuild.js.map