@sentry/node
Version:
Sentry Node SDK using OpenTelemetry for performance instrumentation
31 lines (30 loc) • 1.1 kB
JavaScript
import { sentryEsbuildPlugin as sentryEsbuildPlugin$1 } from "@sentry/bundler-plugins/esbuild";
import { sentryOrchestrionPlugin } from "@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 = sentryEsbuildPlugin$1(options);
const orchestrionPlugin = sentryOrchestrionPlugin(options);
return {
name: "sentry-node-esbuild",
async setup(build) {
await bundlerPlugin.setup(build);
await orchestrionPlugin.setup(build);
}
};
}
export { sentryEsbuildPlugin };
//# sourceMappingURL=esbuild.js.map