pub trait ChunkingContext:
Send
+ Sync
+ NonLocalValue
+ ValueDebug {
Show 25 methods
// Required methods
fn name(self: Vc<Self>) -> Vc<RcStr>
where Self: Sized;
fn should_use_file_source_map_uris(self: Vc<Self>) -> Vc<bool>
where Self: Sized;
fn root_path(self: Vc<Self>) -> Vc<FileSystemPath>
where Self: Sized;
fn output_root(self: Vc<Self>) -> Vc<FileSystemPath>
where Self: Sized;
fn output_root_to_root_path(self: Vc<Self>) -> Vc<RcStr>
where Self: Sized;
fn environment(self: Vc<Self>) -> Vc<Environment>
where Self: Sized;
fn chunk_root_path(self: Vc<Self>) -> Vc<FileSystemPath>
where Self: Sized;
fn chunk_path(
self: Vc<Self>,
asset: Option<Vc<Box<dyn Asset>>>,
ident: Vc<AssetIdent>,
extension: RcStr,
) -> Vc<FileSystemPath>
where Self: Sized;
fn reference_chunk_source_maps(
self: Vc<Self>,
chunk: Vc<Box<dyn OutputAsset>>,
) -> Vc<bool>
where Self: Sized;
fn reference_module_source_maps(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<bool>
where Self: Sized;
fn asset_url(self: Vc<Self>, ident: Vc<FileSystemPath>) -> Vc<RcStr>
where Self: Sized;
fn asset_path(
self: Vc<Self>,
content_hash: RcStr,
original_asset_ident: Vc<AssetIdent>,
) -> Vc<FileSystemPath>
where Self: Sized;
fn async_loader_chunk_item(
self: Vc<Self>,
module: Vc<Box<dyn ChunkableModule>>,
module_graph: Vc<ModuleGraph>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<Box<dyn ChunkItem>>
where Self: Sized;
fn async_loader_chunk_item_id(
self: Vc<Self>,
module: Vc<Box<dyn ChunkableModule>>,
) -> Vc<ModuleId>
where Self: Sized;
fn chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<ChunkGroupResult>
where Self: Sized;
fn evaluated_chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<ChunkGroupResult>
where Self: Sized;
fn entry_chunk_group(
self: Vc<Self>,
path: Vc<FileSystemPath>,
evaluatable_assets: Vc<EvaluatableAssets>,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<EntryChunkGroupResult>
where Self: Sized;
fn chunk_item_id_from_ident(
self: Vc<Self>,
ident: Vc<AssetIdent>,
) -> Vc<ModuleId>
where Self: Sized;
// Provided methods
fn is_hot_module_replacement_enabled(self: Vc<Self>) -> Vc<bool>
where Self: Sized { ... }
fn chunking_configs(self: Vc<Self>) -> Vc<ChunkingConfigs>
where Self: Sized { ... }
fn batching_config(self: Vc<Self>) -> Vc<BatchingConfig>
where Self: Sized { ... }
fn is_tracing_enabled(self: Vc<Self>) -> Vc<bool>
where Self: Sized { ... }
fn minify_type(self: Vc<Self>) -> Vc<MinifyType>
where Self: Sized { ... }
fn chunk_item_id(
self: Vc<Self>,
module: Vc<Box<dyn ChunkItem>>,
) -> Vc<ModuleId>
where Self: Sized { ... }
fn chunk_item_id_from_module(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<ModuleId>
where Self: Sized { ... }
}
Expand description
A context for the chunking that influences the way chunks are created
Required Methods§
fn name(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
fn should_use_file_source_map_uris(self: Vc<Self>) -> Vc<bool>where
Self: Sized,
Sourcefn root_path(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
fn root_path(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
The root path of the project
Sourcefn output_root(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
fn output_root(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
The output root path in the output filesystem
Sourcefn output_root_to_root_path(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
fn output_root_to_root_path(self: Vc<Self>) -> Vc<RcStr>where
Self: Sized,
A relative path how to reach the root path from the output root. This is used to compute original paths at runtime relative to the output files. e. g. import.meta.url needs that.
fn environment(self: Vc<Self>) -> Vc<Environment>where
Self: Sized,
Sourcefn chunk_root_path(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
fn chunk_root_path(self: Vc<Self>) -> Vc<FileSystemPath>where
Self: Sized,
The path to the folder where all chunks are placed. This can be used to compute relative paths.
fn chunk_path(
self: Vc<Self>,
asset: Option<Vc<Box<dyn Asset>>>,
ident: Vc<AssetIdent>,
extension: RcStr,
) -> Vc<FileSystemPath>where
Self: Sized,
Sourcefn reference_chunk_source_maps(
self: Vc<Self>,
chunk: Vc<Box<dyn OutputAsset>>,
) -> Vc<bool>where
Self: Sized,
fn reference_chunk_source_maps(
self: Vc<Self>,
chunk: Vc<Box<dyn OutputAsset>>,
) -> Vc<bool>where
Self: Sized,
Reference Source Map Assets for chunks
Sourcefn reference_module_source_maps(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<bool>where
Self: Sized,
fn reference_module_source_maps(
self: Vc<Self>,
module: Vc<Box<dyn Module>>,
) -> Vc<bool>where
Self: Sized,
Include Source Maps for modules
Sourcefn asset_url(self: Vc<Self>, ident: Vc<FileSystemPath>) -> Vc<RcStr>where
Self: Sized,
fn asset_url(self: Vc<Self>, ident: Vc<FileSystemPath>) -> Vc<RcStr>where
Self: Sized,
Returns a URL (relative or absolute, depending on the asset prefix) to
the static asset based on its ident
.
fn asset_path(
self: Vc<Self>,
content_hash: RcStr,
original_asset_ident: Vc<AssetIdent>,
) -> Vc<FileSystemPath>where
Self: Sized,
fn async_loader_chunk_item(
self: Vc<Self>,
module: Vc<Box<dyn ChunkableModule>>,
module_graph: Vc<ModuleGraph>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<Box<dyn ChunkItem>>where
Self: Sized,
fn async_loader_chunk_item_id(
self: Vc<Self>,
module: Vc<Box<dyn ChunkableModule>>,
) -> Vc<ModuleId>where
Self: Sized,
fn chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<ChunkGroupResult>where
Self: Sized,
fn evaluated_chunk_group(
self: Vc<Self>,
ident: Vc<AssetIdent>,
chunk_group: ChunkGroup,
module_graph: Vc<ModuleGraph>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<ChunkGroupResult>where
Self: Sized,
Sourcefn entry_chunk_group(
self: Vc<Self>,
path: Vc<FileSystemPath>,
evaluatable_assets: Vc<EvaluatableAssets>,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<EntryChunkGroupResult>where
Self: Sized,
fn entry_chunk_group(
self: Vc<Self>,
path: Vc<FileSystemPath>,
evaluatable_assets: Vc<EvaluatableAssets>,
module_graph: Vc<ModuleGraph>,
extra_chunks: Vc<OutputAssets>,
availability_info: Value<AvailabilityInfo>,
) -> Vc<EntryChunkGroupResult>where
Self: Sized,
Generates an output chunk that:
- loads the given extra_chunks in addition to the generated chunks; and
- evaluates the given assets; and
- exports the result of evaluating the last module as a CommonJS default export.