Skip to content

Commit

Permalink
fix(aws-serverless): Avoid minifying Module._resolveFilename in Lam…
Browse files Browse the repository at this point in the history
…bda layer bundle (#12232)

FIx one of the two issues that currently cause our lambda
layer to break. When we build the lambda layer bundle we applied
minification via our terser plugin which mangles `_`-prefixed private
variables - like `Module._resolveFilename`. This patch adds the method
to the list of excluded `_`-prefixed symbols.
  • Loading branch information
Lms24 committed May 27, 2024
1 parent 2043f2d commit c2b9079
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev-packages/rollup-utils/plugins/bundlePlugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ export function makeTerserPlugin() {
'_sentrySpan',
'_sentryScope',
'_sentryIsolationScope',
// require-in-the-middle calls `Module._resolveFilename`. We cannot mangle this (AWS lambda layer bundle).
'_resolveFilename',
],
},
},
Expand Down

0 comments on commit c2b9079

Please sign in to comment.