Skip to content

feat: allow additional NODE_OPTIONS #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"lint": "eslint . --fix",
"prettier": "prettier . --write",
"prepare": "husky",
"add-bang": "sed -i '1s|^|#!/usr/bin/env node\\n|' ./dist/lldebugger.mjs",
"add-bang": "printf '#!/usr/bin/env node\\n%s' \"$(cat ./dist/lldebugger.mjs)\" > ./dist/lldebugger.mjs.tmp && mv ./dist/lldebugger.mjs.tmp ./dist/lldebugger.mjs",
"build": "tsc -p tsconfig.build.json && cp src/nodeWorkerRunner.mjs dist && cp src/frameworks/cdkFrameworkWorker.mjs dist/frameworks && node fix-imports.js && npm run add-bang && npm run bundle-extension",
"bundle-extension": "cd src/extension && npm run build && cd ../../",
"deploy-github-role": "aws cloudformation deploy --stack-name lld-deploy-role --template-file cloudformation/gitHubDeployRole.yaml --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM --profile lldebugger",
Expand Down
11 changes: 10 additions & 1 deletion src/infraDeploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,19 @@ function getEnvironmentVarablesForDebugger(
functionId: string,
timeout: number | undefined,
): Record<string, string> {
const baseNodeOptions = '--enable-source-maps';
const additionalNodeOptions =
Configuration.config.additionalNodeOptions || '';
const nodeOptions = [baseNodeOptions, additionalNodeOptions]
.filter(Boolean)
.join(' ');

console.log('nodeOptions', nodeOptions);

return {
LLD_FUNCTION_ID: functionId,
AWS_LAMBDA_EXEC_WRAPPER: '/opt/lld-wrapper',
NODE_OPTIONS: '--enable-source-maps',
NODE_OPTIONS: nodeOptions,
LLD_DEBUGGER_ID: Configuration.config.debuggerId,
LLD_INITIAL_TIMEOUT: timeout ? timeout.toString() : '-1', // should never be negative
LLD_OBSERVABLE_MODE: Configuration.config.observable ? 'true' : 'false',
Expand Down
5 changes: 5 additions & 0 deletions src/types/lldConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ export type LldConfigBase = {
* Monorepo subfolder
*/
subfolder?: string;

/**
* Additional Node options
*/
additionalNodeOptions?: string;
} & AwsConfiguration;

export type LldConfigCliArgs = {
Expand Down
Loading