File tree Expand file tree Collapse file tree 4 files changed +18
-17
lines changed Expand file tree Collapse file tree 4 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -559,19 +559,9 @@ function getEnvironmentVarablesForDebugger(
559
559
functionId : string ,
560
560
timeout : number | undefined ,
561
561
) : Record < string , string > {
562
- const baseNodeOptions = '--enable-source-maps' ;
563
- const additionalNodeOptions =
564
- Configuration . config . additionalNodeOptions || '' ;
565
- const nodeOptions = [ baseNodeOptions , additionalNodeOptions ]
566
- . filter ( Boolean )
567
- . join ( ' ' ) ;
568
-
569
- console . log ( 'nodeOptions' , nodeOptions ) ;
570
-
571
562
return {
572
563
LLD_FUNCTION_ID : functionId ,
573
564
AWS_LAMBDA_EXEC_WRAPPER : '/opt/lld-wrapper' ,
574
- NODE_OPTIONS : nodeOptions ,
575
565
LLD_DEBUGGER_ID : Configuration . config . debuggerId ,
576
566
LLD_INITIAL_TIMEOUT : timeout ? timeout . toString ( ) : '-1' , // should never be negative
577
567
LLD_OBSERVABLE_MODE : Configuration . config . observable ? 'true' : 'false' ,
Original file line number Diff line number Diff line change @@ -34,12 +34,15 @@ async function runInWorker(input: {
34
34
) ;
35
35
36
36
if ( ! worker ) {
37
+ const environment = input . environment ;
38
+ addEnableSourceMapsToEnv ( environment ) ;
39
+
37
40
worker = startWorker ( {
38
41
handler : func . handler ?? 'handler' ,
39
42
artifactFile : input . artifactFile ,
40
43
workerId : input . fuctionRequest . workerId ,
41
44
functionId : input . fuctionRequest . functionId ,
42
- environment : input . environment ,
45
+ environment,
43
46
verbose : Configuration . config . verbose ,
44
47
} ) ;
45
48
worker . used = false ;
@@ -85,6 +88,20 @@ async function runInWorker(input: {
85
88
} ) ;
86
89
}
87
90
91
+ /**
92
+ * Add NODE_OPTIONS: --enable-source-maps to the environment variables
93
+ * @param environment
94
+ */
95
+ function addEnableSourceMapsToEnv ( environment : {
96
+ [ key : string ] : string | undefined ;
97
+ } ) {
98
+ const nodeOptions = environment . NODE_OPTIONS || '' ;
99
+ if ( ! nodeOptions . includes ( '--enable-source-maps' ) ) {
100
+ environment . NODE_OPTIONS =
101
+ nodeOptions + ( nodeOptions ? ' ' : '' ) + '--enable-source-maps' ;
102
+ }
103
+ }
104
+
88
105
type WorkerRequest = {
89
106
handler : string ;
90
107
artifactFile : string ;
Original file line number Diff line number Diff line change @@ -68,11 +68,6 @@ export type LldConfigBase = {
68
68
* Monorepo subfolder
69
69
*/
70
70
subfolder ?: string ;
71
-
72
- /**
73
- * Additional Node options
74
- */
75
- additionalNodeOptions ?: string ;
76
71
} & AwsConfiguration ;
77
72
78
73
export type LldConfigCliArgs = {
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ export async function expectInfraDeployed(lambdaName: any) {
15
15
LLD_DEBUGGER_ID : expect . any ( String ) ,
16
16
LLD_FUNCTION_ID : expect . any ( String ) ,
17
17
LLD_INITIAL_TIMEOUT : expect . any ( String ) ,
18
- NODE_OPTIONS : '--enable-source-maps' ,
19
18
} ) ;
20
19
21
20
const initialTimeout = parseInt (
You can’t perform that action at this time.
0 commit comments