Skip to content
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

chore: writes compiled mongosh to lib-boxednode instead of lib to avoid linking it twice when building node #43

Merged
Merged
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ async function compileJSFileAsBinaryImpl (options: CompilationOptions, logger: L
}

logger.stepStarting('Inserting custom code into Node.js source');
await fs.mkdir(path.join(nodeSourcePath, 'lib', namespace), { recursive: true });
await fs.mkdir(path.join(nodeSourcePath, 'lib-boxednode', namespace), { recursive: true });
let entryPointTrampolineSource = await fs.readFile(
path.join(__dirname, '..', 'resources', 'entry-point-trampoline.js'), 'utf8');
entryPointTrampolineSource = entryPointTrampolineSource.replace(
Expand All @@ -322,9 +322,9 @@ async function compileJSFileAsBinaryImpl (options: CompilationOptions, logger: L
enableBindingsPatch
}));
await fs.writeFile(
path.join(nodeSourcePath, 'lib', namespace, `${namespace}.js`),
path.join(nodeSourcePath, 'lib-boxednode', namespace, `${namespace}.js`),
entryPointTrampolineSource);
extraJSSourceFiles.push(`./lib/${namespace}/${namespace}.js`);
extraJSSourceFiles.push(`./lib-boxednode/${namespace}/${namespace}.js`);
logger.stepCompleted();

logger.stepStarting('Storing executable metadata');
Expand Down
Loading