@sentry/nextjs
Version:
Official Sentry SDK for Next.js
24 lines (20 loc) • 867 B
JavaScript
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
const bundlerPluginCore = require('@sentry/bundler-plugin-core');
function componentAnnotationLoader(userCode) {
const options = "getOptions" in this ? this.getOptions() : this.query;
const ignoredComponents = options.ignoredComponents ?? [];
this.cacheable(false);
const callback = this.async() ?? this.callback;
const hooks = bundlerPluginCore.createComponentNameAnnotateHooks(ignoredComponents, false);
hooks.transform(userCode, this.resourcePath).then((result) => {
if (result) {
callback(null, result.code, result.map);
} else {
callback(null, userCode);
}
}).catch(() => {
callback(null, userCode);
});
}
exports.default = componentAnnotationLoader;
//# sourceMappingURL=componentAnnotationLoader.js.map