Skip to content

Commit cdf3f81

Browse files
authored
Merge 583e4b9 into 1194330
2 parents 1194330 + 583e4b9 commit cdf3f81

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @ts-ignore
2+
process.turbopack = {};

crates/turbopack-node/src/evaluate.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ pub async fn get_evaluate_pool(
9292
let (Some(cwd), Some(entrypoint)) = (to_sys_path(cwd).await?, to_sys_path(path).await?) else {
9393
panic!("can only evaluate from a disk filesystem");
9494
};
95+
96+
let runtime_entries = {
97+
let globals_module = EcmascriptModuleAssetVc::new(
98+
SourceAssetVc::new(embed_file_path("globals.ts")).into(),
99+
context,
100+
Value::new(EcmascriptModuleAssetType::Typescript),
101+
EcmascriptInputTransformsVc::cell(vec![EcmascriptInputTransform::TypeScript]),
102+
context.environment(),
103+
)
104+
.as_ecmascript_chunk_placeable();
105+
106+
let mut entries = vec![globals_module];
107+
if let Some(other_entries) = runtime_entries {
108+
for entry in &*other_entries.await? {
109+
entries.push(entry.clone())
110+
}
111+
};
112+
113+
Some(EcmascriptChunkPlaceablesVc::cell(entries))
114+
};
115+
95116
let bootstrap = NodeJsBootstrapAsset {
96117
path,
97118
chunk_group: ChunkGroupVc::from_chunk(

0 commit comments

Comments
 (0)