diff --git a/packages/plugins/rum/src/privacy/index.ts b/packages/plugins/rum/src/privacy/index.ts index c43f6a97..764a9f01 100644 --- a/packages/plugins/rum/src/privacy/index.ts +++ b/packages/plugins/rum/src/privacy/index.ts @@ -36,7 +36,14 @@ export const getPrivacyPlugin = ( }, handler(code, id) { try { - const result = instrument({ id, code }, transformOptions); + const inputSourceMap = this.getInputSourceMap?.(); + let map: string | undefined; + if (typeof inputSourceMap === 'string') { + map = inputSourceMap; + } else if (inputSourceMap) { + map = JSON.stringify(inputSourceMap); + } + const result = instrument({ id, code, map }, transformOptions); if (result.privacyDictionarySize === 0) { return { // This should be the same as the result from js-instrumentation-wasm