@sentry/nextjs
Version:
Official Sentry SDK for Next.js
22 lines (19 loc) • 756 B
JavaScript
import { createComponentNameAnnotateHooks } from '@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 = 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);
});
}
export { componentAnnotationLoader as default };
//# sourceMappingURL=componentAnnotationLoader.js.map