Commit 1b4c76c5 authored by Luke Sandberg's avatar Luke Sandberg

more comments

parent 0a59e8c3
......@@ -70,10 +70,15 @@ impl Module for WorkerLoaderModule {
impl Asset for WorkerLoaderModule {
#[turbo_tasks::function]
fn content(&self) -> Vc<AssetContent> {
// Delegate to the inner module's content for tools like node-file-trace
// that need to emit the actual worker file. This wont be called during actual chunking
// A better solution might be to produce these loaders during chunking (like
// AsyncModuleLoaders). This would require a better understanding of isolated entry points.
// For content(), we delegate to the inner module because:
// 1. During normal chunking/bundling, content() is not called - instead the chunk item's
// code_generation() is used, which generates the worker loader code
// 2. During tracing (e.g. node-file-trace), content() is called to emit all referenced
// files, and we want to include the actual worker file, not a synthetic loader
// 3. This follows the same pattern as other transform modules:
// - TracedAsset: delegates to inner module (explicit tracing wrapper)
// - EcmascriptModulePartAsset: delegates to full module (tree-shaking wrapper)
// - CachedExternalModule: returns NotFound (build-time only, no source to trace)
self.inner.content()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment