Skip to content

Commit c2b9079

Browse files
authored
fix(aws-serverless): Avoid minifying Module._resolveFilename in Lambda 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.
1 parent 2043f2d commit c2b9079

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dev-packages/rollup-utils/plugins/bundlePlugins.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export function makeTerserPlugin() {
128128
'_sentrySpan',
129129
'_sentryScope',
130130
'_sentryIsolationScope',
131+
// require-in-the-middle calls `Module._resolveFilename`. We cannot mangle this (AWS lambda layer bundle).
132+
'_resolveFilename',
131133
],
132134
},
133135
},

0 commit comments

Comments
 (0)