Unverified Commit 06b48972 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

Turbopack: respect max_chunk_size while merging production chunks

Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent 4e0848bf
......@@ -47,7 +47,7 @@ use crate::{
runtime_entry::{RuntimeEntries, RuntimeEntry},
transforms::get_next_client_transforms_rules,
},
next_config::NextConfig,
next_config::{ChunkingConfigOptionNames, NextConfig, warn_on_adjusted_chunking_config},
next_import_map::{
get_next_client_fallback_import_map, get_next_client_import_map,
get_next_client_resolved_map,
......@@ -574,7 +574,7 @@ pub async fn get_client_chunking_context(
let service_worker_scope_base_path = service_worker_scope_base_path.owned().await?;
let cross_origin_loading = *cross_origin.await?;
let mut builder = BrowserChunkingContext::builder(
root_path,
root_path.clone(),
client_root.clone(),
client_root_to_root_path,
client_root.clone(),
......@@ -632,10 +632,7 @@ pub async fn get_client_chunking_context(
// A manifest chunk keeps a lazily compiled import's URL stable across activation.
.manifest_chunks(*lazy_dynamic_imports.await?);
} else {
builder = builder
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ChunkingConfig {
let ecmascript_chunking_config = ChunkingConfig {
min_chunk_size: chunking_min_chunk_size.unwrap_or(50_000),
max_chunk_count_per_group: chunking_max_chunk_count_per_group.unwrap_or(40),
max_merge_chunk_size: chunking_max_merge_chunk_size.unwrap_or(200_000),
......@@ -648,7 +645,21 @@ pub async fn get_client_chunking_context(
generate_component_chunks: *generate_component_chunks.await?,
min_component_chunk_size: chunking_min_component_chunk_size.unwrap_or(20_000),
..Default::default()
};
warn_on_adjusted_chunking_config(
&ecmascript_chunking_config,
&ChunkingConfigOptionNames {
chunks: "client",
max_chunk_size: "maxChunkSize",
min_chunk_size: Some("minChunkSize"),
max_merge_chunk_size: Some("maxMergeChunkSize"),
},
root_path.clone(),
);
builder = builder
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ecmascript_chunking_config,
)
.chunking_config(
Vc::<CssChunkType>::default().to_resolved().await?,
......
......@@ -24,7 +24,7 @@ use turbopack::module_options::{
WebpackRules, module_options_context::MdxTransformOptions,
};
use turbopack_core::{
chunk::{CrossOrigin, SourceMapsType},
chunk::{ChunkingConfig, CrossOrigin, SourceMapsType},
issue::{
IgnoreIssue, IgnoreIssuePattern, Issue, IssueExt, IssueSeverity, IssueStage, StyledString,
},
......@@ -966,13 +966,14 @@ pub struct TurbopackChunkingConfig {
/// chunks. This keeps code in big chunks from being duplicated across multiple chunks.
max_merge_chunk_size: Option<usize>,
/// Best-effort maximum estimated size of a client JavaScript chunk, in bytes of
/// uncompressed, unminified code (default `1000000`). Bigger chunks are split
/// deterministically into smaller chunks, which may be smaller than `min_chunk_size` or
/// exceed `max_chunk_count_per_group`. Split merged chunks do not emit component chunks. `0`
/// disables splitting.
/// uncompressed, unminified code (default `1000000`). Chunks are never merged into bigger
/// chunks, and chunks that are bigger on their own are split deterministically into smaller
/// chunks, which may be smaller than `min_chunk_size` or exceed `max_chunk_count_per_group`.
/// Inconsistent values (smaller than 3 times `min_chunk_size`, or than `max_merge_chunk_size`)
/// are adjusted with a warning. `0` disables the limit.
max_chunk_size: Option<usize>,
/// Like `max_chunk_size`, but for Node.js server and edge JavaScript chunks (default
/// `10000000`). `0` disables splitting.
/// `10000000`). `0` disables the limit.
max_server_chunk_size: Option<usize>,
/// Emit each merged production chunk's constituent component chunks alongside it, so the
/// browser runtime can load only the chunks it doesn't already have (default `false`).
......@@ -1564,6 +1565,139 @@ fn turbopack_config_documentation_link() -> RcStr {
)
}
/// How the size limits of a production JS chunking config map to Next.js config options, for
/// [`warn_on_adjusted_chunking_config`].
pub struct ChunkingConfigOptionNames {
/// The kind of chunks the config is for, e.g. `client`.
pub chunks: &'static str,
/// The option for `max_chunk_size`.
pub max_chunk_size: &'static str,
/// The option for `min_chunk_size`, or `None` when it is not configurable.
pub min_chunk_size: Option<&'static str>,
/// The option for `max_merge_chunk_size`, or `None` when it is not configurable.
pub max_merge_chunk_size: Option<&'static str>,
}
/// [`ChunkingConfigOptionNames`] of Node.js server chunks.
pub const SERVER_CHUNKING_CONFIG_OPTION_NAMES: ChunkingConfigOptionNames =
ChunkingConfigOptionNames {
chunks: "server",
max_chunk_size: "maxServerChunkSize",
min_chunk_size: None,
max_merge_chunk_size: None,
};
/// [`ChunkingConfigOptionNames`] of edge server chunks.
pub const EDGE_CHUNKING_CONFIG_OPTION_NAMES: ChunkingConfigOptionNames =
ChunkingConfigOptionNames {
chunks: "edge server",
max_chunk_size: "maxServerChunkSize",
min_chunk_size: None,
max_merge_chunk_size: None,
};
/// Turbopack normalizes the size limits of a chunking config (see [`ChunkingConfig::normalized`]).
/// Emits a warning when that adjusts the values of `config`, so that the user can fix the
/// `experimental.turbopackChunking` options.
pub fn warn_on_adjusted_chunking_config(
config: &ChunkingConfig,
names: &ChunkingConfigOptionNames,
file_path: FileSystemPath,
) {
let normalized = config.normalized();
let option = |name: Option<&str>, fallback: &str| match name {
Some(name) => format!("`experimental.turbopackChunking.{name}`"),
None => fallback.to_string(),
};
let max_chunk_size = option(Some(names.max_chunk_size), "");
let mut adjustments = Vec::new();
if normalized.max_chunk_size != config.max_chunk_size {
adjustments.push(format!(
"{max_chunk_size} ({}) was increased to {} (3 times {} of {}).",
config.max_chunk_size,
normalized.max_chunk_size,
option(
names.min_chunk_size,
&format!("the minimum {} chunk size", names.chunks)
),
config.min_chunk_size,
));
}
if normalized.max_merge_chunk_size != config.max_merge_chunk_size {
adjustments.push(format!(
"{} ({}) was decreased to {}, the maximum chunk size from {max_chunk_size}.",
option(
names.max_merge_chunk_size,
&format!("The maximum merge size of {} chunks", names.chunks)
),
if config.max_merge_chunk_size == 0 {
"unlimited".to_string()
} else {
config.max_merge_chunk_size.to_string()
},
normalized.max_merge_chunk_size,
));
}
if adjustments.is_empty() {
return;
}
AdjustedChunkingConfigIssue {
file_path,
chunks: names.chunks.into(),
adjustments: adjustments.into_iter().map(RcStr::from).collect(),
}
.resolved_cell()
.emit();
}
#[turbo_tasks::value(shared)]
struct AdjustedChunkingConfigIssue {
file_path: FileSystemPath,
chunks: RcStr,
adjustments: Vec<RcStr>,
}
#[async_trait]
#[turbo_tasks::value_impl]
impl Issue for AdjustedChunkingConfigIssue {
fn severity(&self) -> IssueSeverity {
IssueSeverity::Warning
}
async fn file_path(&self) -> Result<FileSystemPath> {
Ok(self.file_path.clone())
}
fn stage(&self) -> IssueStage {
IssueStage::Config
}
async fn title(&self) -> Result<StyledString> {
Ok(StyledString::Text(
format!(
"Inconsistent chunk size limits for {} chunks were adjusted",
self.chunks
)
.into(),
))
}
async fn description(&self) -> Result<Option<StyledString>> {
Ok(Some(StyledString::Stack(
std::iter::once(StyledString::Text(rcstr!(
"The maximum chunk size must be at least 3 times the minimum chunk size, and \
chunks bigger than the maximum chunk size are never merged:"
)))
.chain(
self.adjustments
.iter()
.map(|adjustment| StyledString::Text(adjustment.clone())),
)
.collect(),
)))
}
}
#[turbo_tasks::value(shared)]
struct InvalidLoaderRuleRenameAsIssue {
glob: RcStr,
......
......@@ -26,7 +26,9 @@ use turbopack_resolve::resolve_options_context::{ResolveOptionsContext, TsConfig
use crate::{
app_structure::CollectedRootParams,
mode::NextMode,
next_config::NextConfig,
next_config::{
EDGE_CHUNKING_CONFIG_OPTION_NAMES, NextConfig, warn_on_adjusted_chunking_config,
},
next_import_map::{get_next_edge_and_server_fallback_import_map, get_next_edge_import_map},
next_server::context::ServerContextType,
next_shared::resolve::NextSharedRuntimeResolvePlugin,
......@@ -225,6 +227,7 @@ pub async fn get_edge_chunking_context_with_client_assets(
style_groups_algorithm,
chunking_max_chunk_size,
} = options;
let issue_file_path = root_path.clone();
let cross_origin_loading = *cross_origin.await?;
let output_root = node_root.join("server/edge")?;
let next_mode = mode.await?;
......@@ -272,14 +275,24 @@ pub async fn get_edge_chunking_context_with_client_assets(
.worker_forwarded_globals(worker_forwarded_globals());
if !next_mode.is_development() {
builder = builder
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ChunkingConfig {
let mut ecmascript_chunking_config = ChunkingConfig {
min_chunk_size: 20_000,
max_chunk_size: chunking_max_chunk_size,
..Default::default()
},
};
// Edge chunks have no explicit merge limit, so use the effective maximum chunk size.
// Chunks bigger than that are never merged anyway.
ecmascript_chunking_config.max_merge_chunk_size =
ecmascript_chunking_config.normalized().max_merge_chunk_size;
warn_on_adjusted_chunking_config(
&ecmascript_chunking_config,
&EDGE_CHUNKING_CONFIG_OPTION_NAMES,
issue_file_path,
);
builder = builder
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ecmascript_chunking_config,
)
.chunking_config(
Vc::<CssChunkType>::default().to_resolved().await?,
......@@ -323,6 +336,7 @@ pub async fn get_edge_chunking_context(
style_groups_algorithm,
chunking_max_chunk_size,
} = options;
let issue_file_path = root_path.clone();
let cross_origin = *cross_origin.await?;
let css_url_suffix = css_url_suffix.to_resolved().await?;
let output_root = node_root.join("server/edge")?;
......@@ -387,14 +401,24 @@ pub async fn get_edge_chunking_context(
.worker_forwarded_globals(worker_forwarded_globals());
if !next_mode.is_development() {
builder = builder
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ChunkingConfig {
let mut ecmascript_chunking_config = ChunkingConfig {
min_chunk_size: 20_000,
max_chunk_size: chunking_max_chunk_size,
..Default::default()
},
};
// Edge chunks have no explicit merge limit, so use the effective maximum chunk size.
// Chunks bigger than that are never merged anyway.
ecmascript_chunking_config.max_merge_chunk_size =
ecmascript_chunking_config.normalized().max_merge_chunk_size;
warn_on_adjusted_chunking_config(
&ecmascript_chunking_config,
&EDGE_CHUNKING_CONFIG_OPTION_NAMES,
issue_file_path,
);
builder = builder
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ecmascript_chunking_config,
)
.chunking_config(
Vc::<CssChunkType>::default().to_resolved().await?,
......
......@@ -46,7 +46,9 @@ use crate::{
app_structure::CollectedRootParams,
mode::NextMode,
next_build::get_postcss_package_mapping,
next_config::NextConfig,
next_config::{
NextConfig, SERVER_CHUNKING_CONFIG_OPTION_NAMES, warn_on_adjusted_chunking_config,
},
next_import_map::{get_next_edge_and_server_fallback_import_map, get_next_server_import_map},
next_server::{
resolve::{ExternalCjsModulesResolvePlugin, ExternalPredicate},
......@@ -1075,6 +1077,7 @@ pub async fn get_server_chunking_context_with_client_assets(
chunking_max_merge_chunk_size,
chunking_max_chunk_size,
} = options;
let issue_file_path = root_path.clone();
let css_url_suffix = css_url_suffix.to_resolved().await?;
let next_mode = mode.await?;
......@@ -1132,10 +1135,7 @@ pub async fn get_server_chunking_context_with_client_assets(
SourceMapSourceType::RelativeUri
});
if next_mode.is_production() {
builder = builder
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ChunkingConfig {
let ecmascript_chunking_config = ChunkingConfig {
// Server chunks are loaded with require(), not fetched over the network.
min_chunk_size: chunking_min_chunk_size.unwrap_or(4_000),
max_chunk_count_per_group: 0,
......@@ -1143,7 +1143,16 @@ pub async fn get_server_chunking_context_with_client_assets(
max_chunk_size: chunking_max_chunk_size,
request_cost: Some(10_000),
..Default::default()
},
};
warn_on_adjusted_chunking_config(
&ecmascript_chunking_config,
&SERVER_CHUNKING_CONFIG_OPTION_NAMES,
issue_file_path,
);
builder = builder
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ecmascript_chunking_config,
)
.chunking_config(
Vc::<CssChunkType>::default().to_resolved().await?,
......@@ -1191,6 +1200,7 @@ pub async fn get_server_chunking_context(
chunking_max_merge_chunk_size,
chunking_max_chunk_size,
} = options;
let issue_file_path = root_path.clone();
let css_url_suffix = css_url_suffix.to_resolved().await?;
let next_mode = mode.await?;
// TODO(alexkirsz) This should return a trait that can be implemented by the
......@@ -1248,11 +1258,7 @@ pub async fn get_server_chunking_context(
if next_mode.is_development() {
builder = builder.source_map_source_type(SourceMapSourceType::AbsoluteFileUri);
} else {
builder = builder
.source_map_source_type(SourceMapSourceType::RelativeUri)
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ChunkingConfig {
let ecmascript_chunking_config = ChunkingConfig {
// Server chunks are loaded with require(), not fetched over the network.
min_chunk_size: chunking_min_chunk_size.unwrap_or(4_000),
max_chunk_count_per_group: 0,
......@@ -1260,7 +1266,17 @@ pub async fn get_server_chunking_context(
max_chunk_size: chunking_max_chunk_size,
request_cost: Some(10_000),
..Default::default()
},
};
warn_on_adjusted_chunking_config(
&ecmascript_chunking_config,
&SERVER_CHUNKING_CONFIG_OPTION_NAMES,
issue_file_path,
);
builder = builder
.source_map_source_type(SourceMapSourceType::RelativeUri)
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ecmascript_chunking_config,
)
.chunking_config(
Vc::<CssChunkType>::default().to_resolved().await?,
......
......@@ -126,16 +126,22 @@ the size of the compressed, minified output).
larger than this size with other chunks. This keeps the code in large chunks
from being duplicated across multiple large output chunks.
- **`maxChunkSize`** (default `1000000`): a best-effort maximum estimated
chunk size. After merging, Turbopack splits client JavaScript chunks bigger
than this into smaller chunks. It sorts their modules by identifier and prefers
splitting where paths differ most (e.g. between two packages), which keeps
splits deterministic and helps avoid unrelated chunk changes. To stay under
the limit, it may create chunks smaller than `minChunkSize` or more chunks
than `maxChunkCountPerGroup`. A single module bigger than this size still
produces a bigger chunk. Set it to `0` to disable splitting.
client JavaScript chunk size. Turbopack never merges chunks into chunks bigger
than this, and splits chunks that are bigger on their own into smaller chunks.
It sorts their modules by identifier and prefers splitting where paths differ
most (e.g. between two packages), which keeps splits deterministic and helps
avoid unrelated chunk changes. To stay under the limit, it may create chunks
smaller than `minChunkSize` or more chunks than `maxChunkCountPerGroup`. A
single module bigger than this size still produces a bigger chunk. It must be
at least 3 times `minChunkSize`, and `maxMergeChunkSize` must not be bigger.
Otherwise, Turbopack increases `maxChunkSize` or decreases
`maxMergeChunkSize` accordingly, and shows a warning. Set it to `0` to disable
the limit.
- **`maxServerChunkSize`** (default `10000000`): like `maxChunkSize`, but for
server (Node.js and edge) JavaScript chunks instead of client chunks. Set it
to `0` to disable splitting.
server (Node.js and edge) JavaScript chunks instead of client chunks. Server
chunks use a fixed minimum chunk size (4 KB for Node.js, 20 KB for edge) and
a fixed `maxMergeChunkSize` of 100 KB for Node.js, which are adjusted the same
way. Set it to `0` to disable the limit.
When merging chunks, the trade-off being made is an improvement to performance on initial page
loads at the cost of navigation performance. This is because each additional network request
......@@ -186,9 +192,6 @@ This avoids re-downloading JavaScript the browser already has when navigating.
this size are folded into a single component instead of being emitted on their own,
to avoid producing many tiny chunks.
When `maxChunkSize` splits a merged chunk, Turbopack emits the split chunks without
component chunks.
</AppOnly>
## Heuristics
......
......@@ -954,15 +954,18 @@ export interface ExperimentalConfig {
maxMergeChunkSize?: number
/**
* Best-effort maximum estimated size of a client JavaScript chunk, in bytes of uncompressed,
* unminified code. Bigger chunks are split deterministically (by module identifier) into
* smaller chunks. Splitting can create chunks smaller than `minChunkSize` or exceed
* `maxChunkCountPerGroup`. Split merged chunks do not emit component chunks. Set to `0` to
* disable splitting. Defaults to `1000000` (1 MB).
* unminified code. Chunks are never merged into bigger chunks, and chunks that are bigger on
* their own are split deterministically (by module identifier) into smaller chunks. This can
* create chunks smaller than `minChunkSize` or exceed `maxChunkCountPerGroup`. Must be at
* least 3 times `minChunkSize`, and not smaller than `maxMergeChunkSize`; otherwise the values
* are adjusted with a warning. Set to `0` to disable the limit. Defaults to `1000000` (1 MB).
*/
maxChunkSize?: number
/**
* Like `maxChunkSize`, but for server (Node.js and edge) JavaScript chunks. Set to `0` to
* disable splitting. Defaults to `10000000` (10 MB).
* Like `maxChunkSize`, but for server (Node.js and edge) JavaScript chunks. Server chunks have
* fixed minimum chunk sizes. Node.js server chunks also have a fixed `maxMergeChunkSize`, while
* edge chunks use the effective maximum chunk size as their merge limit. Set to `0` to disable
* the limit. Defaults to `10000000` (10 MB).
*/
maxServerChunkSize?: number
/**
......
......@@ -19,7 +19,7 @@ import { join, relative } from 'path'
'next.config.js',
`module.exports = ${JSON.stringify({ experimental }, null, 2)}`
)
const { exitCode } = await next.build()
const { exitCode, cliOutput } = await next.build()
expect(exitCode).toBe(0)
}
......@@ -32,7 +32,7 @@ import { join, relative } from 'path'
const serverChunks = (
await recursiveReadDir(join(distDir, 'server', 'chunks'))
).filter((name) => name.endsWith('.js'))
return { clientChunks, serverChunks }
return { clientChunks, serverChunks, cliOutput }
}
// Lists the Node.js server JS chunks of the last build. The server size
......@@ -45,18 +45,23 @@ import { join, relative } from 'path'
}
// Force the chunker to merge as much as possible into as few chunks as
// possible.
// possible. `maxChunkSize` is disabled, since it must be at least 3 times
// `minChunkSize`.
const mergeAll = {
minChunkSize: 100_000_000,
maxMergeChunkSize: 100_000_000,
maxChunkCountPerGroup: 1,
maxChunkSize: 0,
}
// Disable merging entirely, so every chunk group emits its own chunks.
// `maxChunkSize` is disabled, since a maximum would also limit the unlimited
// `maxMergeChunkSize`.
const noMerge = {
minChunkSize: 0,
maxChunkCountPerGroup: 0,
maxMergeChunkSize: 0,
maxChunkSize: 0,
}
// Server-side equivalent of `mergeAll`.
......@@ -72,16 +77,27 @@ import { join, relative } from 'path'
let mergeAllWithMaxChunkSizeOutput: BuildOutput
let mergeAllWithMaxServerChunkSizeOutput: BuildOutput
// Merge everything, but split client chunks bigger than a small maximum size again.
// Merge as much as possible, but never into client chunks bigger than a small maximum size, and
// split chunks bigger than that.
const mergeAllWithMaxChunkSize = {
...mergeAll,
minChunkSize: 5_000,
maxMergeChunkSize: 20_000,
maxChunkSize: 20_000,
}
// Merge everything, but split server chunks bigger than a small maximum size again.
// Merge everything, but split server chunks bigger than a small maximum size. Node.js server
// chunks have a fixed `maxMergeChunkSize` of 100 KB, so a smaller maximum size would be adjusted.
const mergeAllWithMaxServerChunkSize = {
...mergeAll,
maxServerChunkSize: 20_000,
maxServerChunkSize: 100_000,
}
// Component chunks of merged chunks must still work when merging respects a maximum size.
const mergeAllWithMaxChunkSizeAndComponentChunks = {
...mergeAllWithMaxChunkSize,
generateComponentChunks: true,
minComponentChunkSize: 0,
}
beforeAll(async () => {
......@@ -155,8 +171,7 @@ import { join, relative } from 'path'
})
it('splits client chunks bigger than maxChunkSize', () => {
// With the same merge settings, a small maxChunkSize splits the big merged chunks into
// more, smaller chunks.
// With smaller merge and size limits, Turbopack emits more, smaller client chunks.
expect(
mergeAllWithMaxChunkSizeOutput.clientChunks.length
).toBeGreaterThan(mergeAllOutput.clientChunks.length)
......@@ -176,9 +191,56 @@ import { join, relative } from 'path'
)
})
it('does not warn about consistent chunk size limits', () => {
for (const output of [
mergeAllOutput,
noMergeOutput,
mergeAllWithMaxChunkSizeOutput,
mergeAllWithMaxServerChunkSizeOutput,
]) {
expect(output.cliOutput).not.toContain('Inconsistent chunk size limits')
}
})
it('warns about and adjusts inconsistent chunk size limits', async () => {
// `maxChunkSize` is smaller than 3 times `minChunkSize` (10 KB), and smaller than
// `maxMergeChunkSize`.
const { cliOutput, clientChunks } = await buildWith({
minChunkSize: 10_000,
maxMergeChunkSize: 100_000,
maxChunkSize: 20_000,
})
expect(cliOutput).toContain(
'Inconsistent chunk size limits for client chunks were adjusted'
)
expect(cliOutput).toContain(
'`experimental.turbopackChunking.maxChunkSize` (20000) was increased to 30000'
)
expect(cliOutput).toContain(
'`experimental.turbopackChunking.maxMergeChunkSize` (100000) was decreased to 30000'
)
expect(clientChunks.length).toBeGreaterThan(0)
})
it('warns when an enabled maxChunkSize limits an unlimited maxMergeChunkSize', async () => {
const { cliOutput } = await buildWith({
minChunkSize: 0,
maxChunkCountPerGroup: 0,
maxMergeChunkSize: 0,
maxChunkSize: 20_000,
})
expect(cliOutput).toContain(
'`experimental.turbopackChunking.maxMergeChunkSize` (unlimited) was decreased to 20000'
)
})
it.each([
['custom chunking', mergeAll],
['maxChunkSize', mergeAllWithMaxChunkSize],
[
'maxChunkSize and component chunks',
mergeAllWithMaxChunkSizeAndComponentChunks,
],
['maxServerChunkSize', mergeAllWithMaxServerChunkSize],
])('renders and navigates correctly with %s', async (_, chunking) => {
await build({ ...chunking, ...serverMergeAll })
......
//! Deterministically splits a list of keyed and sized items into groups that are not bigger than a
//! maximum size.
//!
//! This is a port of webpack's `deterministicGrouping` (used for `splitChunks.maxSize`), simplified
//! This is based on webpack's `deterministicGrouping` (used for `splitChunks.maxSize`), simplified
//! to a single scalar size:
//!
//! 1. Items are sorted by their key (the module identifier) in UTF-8 byte order.
//! 2. Items bigger than the maximum size become their own group.
//! 3. The remaining items are recursively bisected. A cut is placed where the key space is
//! separated the most (the lowest similarity between two adjacent keys), while keeping both
//! sides at least `max_size / 3` big when possible.
//! 1. Items bigger than the maximum size become their own group.
//! 2. The remaining items are sorted by their key (the module identifier) in UTF-8 byte order.
//! 3. The sorted items are recursively bisected. A cut is placed where the key space is separated
//! the most (the shortest shared prefix of two adjacent keys), while keeping both sides at least
//! the minimum size big when possible. On ties, the cut that splits the size most evenly wins,
//! then the leftmost one.
//!
//! Placing cuts at "natural" boundaries in the sorted key space (e.g. between two packages or
//! directories) is intended to keep unrelated changes from moving many boundaries. This is a
//! heuristic, not a guarantee.
//!
//! Unlike webpack, the maximum size is preferred over the minimum size: when no cut can keep both
//! sides at least `max_size / 3` big, a cut is made anyway. This can create groups smaller than
//! `max_size / 3`. A group bigger than `max_size` is only produced for a single oversized item.
//! Similarity also compares UTF-8 bytes instead of webpack's UTF-16 code units, which is identical
//! for ASCII keys and still deterministic for non-ASCII keys.
//! sides at least the minimum size big, a cut is made anyway. This can create groups smaller than
//! the minimum size. A group bigger than the maximum size is only produced for a single oversized
//! item.
use std::ops::Range;
use std::{cmp::Ordering, ops::Range};
/// Splits `items` into groups whose total size is not bigger than `max_size`, unless a single item
/// is already bigger than `max_size`.
/// is already bigger than `max_size`. Groups are kept at least `min_size` big where possible.
///
/// Each item is a tuple of the item itself, its key and its size. Keys are expected to be unique.
/// When items are split, unique keys make the result independent of the order of `items`; within a
......@@ -33,6 +33,7 @@ use std::ops::Range;
/// single group with all items in their input order is returned (no group when there are no items).
pub fn deterministic_grouping<T, K: AsRef<str>>(
items: Vec<(T, K, usize)>,
min_size: usize,
max_size: usize,
) -> Vec<Vec<T>> {
let total_size: usize = items.iter().map(|(_, _, size)| *size).sum();
......@@ -42,32 +43,19 @@ pub fn deterministic_grouping<T, K: AsRef<str>>(
}
return vec![items.into_iter().map(|(item, _, _)| item).collect()];
}
let min_size = max_size / 3;
let mut items = items;
// Items bigger than `max_size` are emitted as their own group. Only the remaining items need to
// be sorted and bisected.
let (oversized, mut nodes): (Vec<_>, Vec<_>) =
items.into_iter().partition(|(_, _, size)| *size > max_size);
// Stable sort, so equal keys keep their input order.
items.sort_by(|(_, a, _), (_, b, _)| a.as_ref().cmp(b.as_ref()));
// Items bigger than `max_size` are emitted as their own group.
let mut nodes = Vec::with_capacity(items.len());
let mut oversized = Vec::new();
for (index, (_, key, size)) in items.iter().enumerate() {
if *size > max_size {
oversized.push(index..index + 1);
} else {
nodes.push(Node {
index,
key: key.as_ref(),
size: *size,
});
}
}
nodes.sort_by(|(_, a, _), (_, b, _)| a.as_ref().cmp(b.as_ref()));
// `prefix[i]` is the total size of `nodes[..i]`.
let mut prefix = Vec::with_capacity(nodes.len() + 1);
prefix.push(0usize);
for node in &nodes {
prefix.push(prefix.last().unwrap() + node.size);
for (_, _, size) in &nodes {
prefix.push(prefix.last().unwrap() + size);
}
let sum = |range: Range<usize>| prefix[range.end] - prefix[range.start];
......@@ -75,17 +63,23 @@ pub fn deterministic_grouping<T, K: AsRef<str>>(
// at position `i + 1`.
let similarities: Vec<usize> = nodes
.windows(2)
.map(|pair| similarity(pair[0].key, pair[1].key))
.map(|pair| similarity(pair[0].1.as_ref(), pair[1].1.as_ref()))
.collect();
// Groups of `nodes`, as ranges of node positions.
let mut groups: Vec<Range<usize>> = Vec::new();
enum Group {
/// A range of positions in `nodes`.
Nodes(Range<usize>),
/// An index into `oversized`.
Oversized(usize),
}
let mut groups: Vec<Group> = Vec::new();
if !nodes.is_empty() {
let mut queue: Vec<Range<usize>> = Vec::new();
queue.push(0..nodes.len());
while let Some(range) = queue.pop() {
if range.len() <= 1 || sum(range.clone()) <= max_size {
groups.push(range);
groups.push(Group::Nodes(range));
continue;
}
let cut = find_cut(range.clone(), min_size, max_size, &sum, &similarities);
......@@ -93,36 +87,29 @@ pub fn deterministic_grouping<T, K: AsRef<str>>(
queue.push(range.start..cut);
}
}
groups.extend((0..oversized.len()).map(Group::Oversized));
// Convert node ranges back into item indices, and order all groups by their first key.
let mut result: Vec<Vec<usize>> = groups
.into_iter()
.map(|range| nodes[range].iter().map(|node| node.index).collect())
.chain(oversized.into_iter().map(|range| range.collect()))
.collect();
// Item indices are positions in the key-sorted `items`, so ordering groups by their first
// index orders them by their first key.
result.sort_unstable_by_key(|group| group[0]);
// Order all groups by their first key.
let first_key = |group: &Group| match group {
Group::Nodes(range) => nodes[range.start].1.as_ref(),
Group::Oversized(index) => oversized[*index].1.as_ref(),
};
groups.sort_by(|a, b| first_key(a).cmp(first_key(b)));
let mut items: Vec<Option<T>> = items.into_iter().map(|(item, _, _)| Some(item)).collect();
result
let mut nodes: Vec<Option<T>> = nodes.into_iter().map(|(item, _, _)| Some(item)).collect();
let mut oversized: Vec<Option<T>> = oversized
.into_iter()
.map(|group| {
group
.map(|(item, _, _)| Some(item))
.collect();
groups
.into_iter()
.map(|index| items[index].take().unwrap())
.collect()
.map(|group| match group {
Group::Nodes(range) => range.map(|i| nodes[i].take().unwrap()).collect(),
Group::Oversized(index) => vec![oversized[index].take().unwrap()],
})
.collect()
}
struct Node<'a> {
/// Index into the key-sorted items.
index: usize,
key: &'a str,
size: usize,
}
/// Finds the position to split the (too big, at least two nodes) `range` at. A cut at position `p`
/// splits `range` into `range.start..p` and `p..range.end`.
fn find_cut(
......@@ -134,7 +121,9 @@ fn find_cut(
) -> usize {
// Possible cuts are `range.start + 1..range.end`, so that both sides have at least one node.
let cuts = range.start + 1..range.end;
let similarity_of_cut = |cut: usize| similarities[cut - 1];
let best_cut = |cuts: &mut dyn Iterator<Item = usize>| {
cuts.min_by(|&a, &b| compare_cuts(a, b, range.clone(), sum, similarities))
};
// Cuts that keep both sides at least `min_size` big form a contiguous range, since the left
// side grows and the right side shrinks with the cut position.
......@@ -149,68 +138,57 @@ fn find_cut(
.unwrap_or(range.start);
if lo <= hi {
// Split where the key space is separated the most, without creating too small groups.
return lowest_similarity(lo..hi + 1, similarity_of_cut).unwrap();
return best_cut(&mut (lo..hi + 1)).unwrap();
}
// No cut keeps both sides at least `min_size` big. Prefer the maximum size: split where the key
// space is separated the most among cuts that make both sides small enough...
if let Some(cut) = lowest_similarity(
cuts.clone()
if let Some(cut) = best_cut(
&mut cuts
.clone()
.filter(|&cut| sum(range.start..cut) <= max_size && sum(cut..range.end) <= max_size),
similarity_of_cut,
) {
return cut;
}
// ...or, if there is no such cut, where the bigger side is as small as possible. Both sides
// are then split further.
let mut best = cuts.start;
let mut best_size = usize::MAX;
for cut in cuts {
let size = sum(range.start..cut).max(sum(cut..range.end));
if size < best_size {
best = cut;
best_size = size;
}
}
best
// ...or, if there is no such cut, where the bigger side is as small as possible (the leftmost
// on ties). Both sides are then split further.
cuts.min_by_key(|&cut| sum(range.start..cut).max(sum(cut..range.end)))
.unwrap()
}
/// Returns the cut with the lowest similarity, preferring the first one on ties.
fn lowest_similarity(
cuts: impl Iterator<Item = usize>,
similarity_of_cut: impl Fn(usize) -> usize,
) -> Option<usize> {
let mut best = None;
let mut best_similarity = usize::MAX;
for cut in cuts {
let similarity = similarity_of_cut(cut);
if best.is_none() || similarity < best_similarity {
best = Some(cut);
best_similarity = similarity;
}
}
best
/// Orders cuts by preference: the lowest similarity first, then the most even split of the size of
/// `range`, then the leftmost cut.
fn compare_cuts(
a: usize,
b: usize,
range: Range<usize>,
sum: &impl Fn(Range<usize>) -> usize,
similarities: &[usize],
) -> Ordering {
let imbalance = |cut: usize| sum(range.start..cut).abs_diff(sum(cut..range.end));
similarities[a - 1]
.cmp(&similarities[b - 1])
.then_with(|| imbalance(a).cmp(&imbalance(b)))
.then_with(|| a.cmp(&b))
}
/// How similar two keys are. Equal bytes at the same position add 10, bytes that are close add
/// less. A low similarity means the key space is separated a lot between the two keys.
/// How similar two keys are: the length of their shared prefix, in bytes. A low similarity means
/// the key space is separated a lot between the two keys.
fn similarity(a: &str, b: &str) -> usize {
a.bytes()
.zip(b.bytes())
.map(|(a, b)| 10usize.saturating_sub(a.abs_diff(b) as usize))
.sum()
a.bytes().zip(b.bytes()).take_while(|(a, b)| a == b).count()
}
#[cfg(test)]
mod tests {
use super::*;
fn group(items: &[(&str, usize)], max_size: usize) -> Vec<Vec<String>> {
fn group(items: &[(&str, usize)], min_size: usize, max_size: usize) -> Vec<Vec<String>> {
deterministic_grouping(
items
.iter()
.map(|&(key, size)| (key.to_string(), key, size))
.collect(),
min_size,
max_size,
)
}
......@@ -227,13 +205,22 @@ mod tests {
.collect()
}
#[test]
fn similarity_is_shared_prefix_length() {
assert_eq!(similarity("abc", "abd"), 2);
assert_eq!(similarity("abc", "abc"), 3);
assert_eq!(similarity("abc", "ab"), 2);
assert_eq!(similarity("abc", "xbc"), 0);
assert_eq!(similarity("", "abc"), 0);
}
#[test]
fn no_split_when_small_enough() {
let items = [("b", 30), ("a", 40), ("c", 30)];
// Order is preserved when nothing is split.
assert_eq!(group(&items, 100), vec![vec!["b", "a", "c"]]);
assert_eq!(group(&items, 0), vec![vec!["b", "a", "c"]]);
assert!(group(&[], 100).is_empty());
assert_eq!(group(&items, 0, 100), vec![vec!["b", "a", "c"]]);
assert_eq!(group(&items, 0, 0), vec![vec!["b", "a", "c"]]);
assert!(group(&[], 0, 100).is_empty());
}
#[test]
......@@ -242,10 +229,11 @@ mod tests {
.map(|i| (format!("[project]/src/file{i:03}.js"), 7 + (i * 13) % 17))
.collect();
let items: Vec<(&str, usize)> = items.iter().map(|(k, s)| (k.as_str(), *s)).collect();
let groups = group(&items, 100);
let groups = group(&items, 30, 100);
assert!(groups.len() > 1);
for size in sizes(&groups, &items) {
assert!(size <= 100, "group size {size} is bigger than max");
assert!(size >= 30, "group size {size} is smaller than min");
}
// All items are kept, sorted by key.
let flat: Vec<&str> = groups.iter().flatten().map(|s| s.as_str()).collect();
......@@ -254,11 +242,27 @@ mod tests {
assert_eq!(flat, expected);
}
#[test]
fn respects_min_size_when_possible() {
// The key space is separated most between "a" and "b", but that cut would leave a too small
// group of 10. The next best cut keeps both sides at least 30 big.
let items = [("a", 10), ("ba", 40), ("bb", 40), ("bc", 40)];
assert_eq!(
group(&items, 30, 100),
vec![vec!["a", "ba"], vec!["bb", "bc"]]
);
// Without a minimum size, the most separating cut wins.
assert_eq!(
group(&items, 0, 100),
vec![vec!["a"], vec!["ba"], vec!["bb", "bc"]]
);
}
#[test]
fn prefers_max_size_over_min_size() {
// No cut keeps both sides at least 100 / 3 big, but the items fit on their own.
// No cut keeps both sides at least 34 big, but the items fit on their own.
assert_eq!(
group(&[("a", 80), ("b", 25)], 100),
group(&[("a", 80), ("b", 25)], 34, 100),
vec![vec!["a"], vec!["b"]]
);
}
......@@ -267,11 +271,11 @@ mod tests {
fn keeps_oversized_item_whole() {
let items = [("a", 10), ("b", 500), ("c", 10)];
// The remaining items are grouped as if the oversized item didn't exist.
let groups = group(&items, 100);
let groups = group(&items, 0, 100);
assert_eq!(groups, vec![vec!["a", "c"], vec!["b"]]);
let items = [("a", 30), ("b", 30), ("c", 500), ("d", 30), ("e", 30)];
let groups = group(&items, 100);
let groups = group(&items, 0, 100);
assert_eq!(groups, vec![vec!["a", "b"], vec!["c"], vec!["d", "e"]]);
}
......@@ -284,26 +288,27 @@ mod tests {
10 + i % 7,
)
})
.chain([("[project]/node_modules/big/index.js".to_string(), 500)])
.collect();
let items: Vec<(&str, usize)> = items.iter().map(|(k, s)| (k.as_str(), *s)).collect();
let expected = group(&items, 120);
let expected = group(&items, 40, 120);
let mut reversed = items.clone();
reversed.reverse();
assert_eq!(group(&reversed, 120), expected);
assert_eq!(group(&reversed, 40, 120), expected);
let mut shuffled = items.clone();
shuffled.sort_by_key(|(k, _)| k.bytes().rev().collect::<Vec<_>>());
assert_eq!(group(&shuffled, 120), expected);
assert_eq!(group(&shuffled, 40, 120), expected);
}
#[test]
fn handles_zero_sized_items() {
let items = [("a", 0), ("b", 60), ("c", 0), ("d", 60), ("e", 0)];
let groups = group(&items, 100);
let groups = group(&items, 30, 100);
for size in sizes(&groups, &items) {
assert!(size <= 100);
}
assert_eq!(groups.iter().map(|g| g.len()).sum::<usize>(), 5);
assert_eq!(group(&[("a", 0), ("b", 0)], 100), vec![vec!["a", "b"]]);
assert_eq!(group(&[("a", 0), ("b", 0)], 0, 100), vec![vec!["a", "b"]]);
}
#[test]
......@@ -318,17 +323,25 @@ mod tests {
let items: Vec<(&str, usize)> = items.iter().map(|(k, s)| (k.as_str(), *s)).collect();
// 120 in total, max 100: the split happens between the two packages, although a split in
// the middle of one package would also be valid.
let groups = group(&items, 100);
let groups = group(&items, 30, 100);
assert_eq!(groups.len(), 2);
assert!(groups[0].iter().all(|k| k.contains("/aaa/")));
assert!(groups[1].iter().all(|k| k.contains("/zzz/")));
}
#[test]
fn deterministic_tie_breaking() {
// All adjacent similarities are equal, so the leftmost valid cut is chosen.
fn ties_prefer_the_most_even_split() {
// All adjacent similarities are equal, so the cut that splits the size most evenly wins
// (50 | 50 instead of 10 | 90 or 20 | 80).
let items = [("a", 10), ("b", 10), ("c", 30), ("d", 50)];
assert_eq!(group(&items, 0, 90), vec![vec!["a", "b", "c"], vec!["d"]]);
}
#[test]
fn remaining_ties_prefer_the_leftmost_cut() {
// Both valid cuts have the same similarity and split the size equally unevenly.
let items = [("a", 40), ("b", 40), ("c", 40)];
assert_eq!(group(&items, 100), vec![vec!["a"], vec!["b", "c"]]);
assert_eq!(group(&items, 0, 100), vec![vec!["a"], vec!["b", "c"]]);
}
#[test]
......@@ -338,33 +351,38 @@ mod tests {
("[project]/src/z/a.js", 40),
("[project]/src/é/a.js", 40),
];
let expected = vec![
vec!["[project]/src/z/a.js"],
vec!["[project]/src/ä/a.js", "[project]/src/é/a.js"],
];
assert_eq!(group(&items, 100), expected);
let expected = group(&items, 0, 100);
assert_eq!(expected.len(), 2);
let mut reversed = items;
reversed.reverse();
assert_eq!(group(&reversed, 100), expected);
assert_eq!(group(&reversed, 0, 100), expected);
}
#[test]
fn mostly_stable_when_adding_an_item() {
fn stable_outside_of_the_changed_part_when_adding_an_item() {
let keys: Vec<String> = (0..100)
.map(|i| format!("[project]/src/dir{}/file{}.js", i / 10, i % 10))
.collect();
let items: Vec<(&str, usize)> = keys.iter().map(|k| (k.as_str(), 10)).collect();
let before = group(&items, 200);
let before = group(&items, 60, 200);
let mut with_new = items.clone();
with_new.push(("[project]/src/dir4/file4b.js", 10));
let after = group(&with_new, 200);
let after = group(&with_new, 60, 200);
let changed = after.iter().filter(|g| !before.contains(g)).count();
assert!(
changed <= 2,
"adding one item changed {changed} of {} groups",
after.len()
);
// The first cut is placed between `dir4` and `dir5` in both cases. Balancing the sizes can
// move the cuts within the half with the new item, but the other half is unchanged.
let in_second_half = |group: &Vec<String>| {
group
.iter()
.all(|key| key.as_str() >= "[project]/src/dir5/")
};
let before_second_half: Vec<_> = before.iter().filter(|g| in_second_half(g)).collect();
let after_second_half: Vec<_> = after.iter().filter(|g| in_second_half(g)).collect();
assert!(!before_second_half.is_empty());
assert_eq!(before_second_half, after_second_half);
for group in &after {
assert!(group.len() * 10 <= 200);
}
}
}
......@@ -328,13 +328,17 @@ pub async fn make_chunks(
let ty_name = ty.to_string().await?;
let span = tracing::trace_span!("make chunks for type", name = display(&ty_name));
async {
let chunking_config = chunking_configs.get(&ty);
let mut split_context = SplitContext {
ty,
chunking_context,
chunks: &mut chunks,
min_component_chunk_size: chunking_config
.filter(|config| config.generate_component_chunks)
.map(|config| config.min_component_chunk_size),
};
if let Some(chunking_config) = chunking_configs.get(&ty) {
if let Some(chunking_config) = chunking_config {
// Production chunking
if *ty.is_style().await? {
make_style_production_chunks(
......@@ -401,6 +405,9 @@ struct SplitContext<'a> {
// resolution of `chunks` is deferred so it can be done with `try_join` at the end, letting as
// much work happen in parallel as possible.
chunks: &'a mut Vec<Vc<Box<dyn Chunk>>>,
/// When set, merged chunks also emit their constituent component chunks (see
/// [`make_chunk`]), with this minimum size for a component chunk to be emitted on its own.
min_component_chunk_size: Option<usize>,
}
fn build_chunk(
......@@ -433,15 +440,74 @@ type ComponentChunkItems<'l> = (
Vec<ResolvedVc<ChunkItemBatchGroup>>,
);
/// One original (pre-merge) chunk that is part of a (merged) chunk. A merged chunk can also expose
/// them as individual component chunks for cache-aware loading at runtime.
struct ChunkComponent<'l> {
size: usize,
chunk_items: Vec<&'l ChunkItemOrBatchWithInfo>,
batch_groups: SmallVec<[ResolvedVc<ChunkItemBatchGroup>; 1]>,
}
/// Groups the `components` of a merged chunk into component chunks. Components smaller than
/// `min_component_chunk_size` are folded into a single remainder component chunk. Returns `None`
/// when there would be less than two component chunks, since that has no benefit.
fn split_into_component_chunks<'l>(
components: Vec<ChunkComponent<'l>>,
min_component_chunk_size: usize,
) -> Option<Vec<ComponentChunkItems<'l>>> {
// A single original part can't benefit from splitting.
if components.len() <= 1 {
return None;
}
let mut component_chunks: Vec<ComponentChunkItems<'l>> = Vec::new();
let mut remainder_items: Vec<&'l ChunkItemOrBatchWithInfo> = Vec::new();
let mut remainder_batch_groups = FxIndexSet::default();
for part in components {
if part.size >= min_component_chunk_size {
component_chunks.push((part.chunk_items, part.batch_groups.into_vec()));
} else {
// we create a "remainder" chunk with smaller component chunks so that
// an entire chunk can be loaded by loading all of its component chunks
remainder_items.extend(part.chunk_items);
remainder_batch_groups.extend(part.batch_groups);
}
}
// TODO (@sampoder): handle the case where there are many the component chunks
// that are only slightly smaller than the min_component_chunk_size. this may
// mean that there is no benefit to component chunking.
if !remainder_items.is_empty() {
component_chunks.push((
remainder_items,
remainder_batch_groups.into_iter().collect(),
));
}
// A split is only worthwhile if it yields more than one component chunk.
if component_chunks.len() <= 1 {
None
} else {
Some(component_chunks)
}
}
/// Creates a chunk with the given `chunk_items. `key` should be unique.
///
/// `components` are the original chunks a merged chunk was created from. When component chunks are
/// enabled in the `split_context`, they are also emitted as component chunks of the chunk.
#[tracing::instrument(level = Level::TRACE, skip_all, fields(key = display(key)))]
async fn make_chunk(
chunk_items: Vec<&'_ ChunkItemOrBatchWithInfo>,
batch_groups: Vec<ResolvedVc<ChunkItemBatchGroup>>,
components: Vec<ComponentChunkItems<'_>>,
components: Vec<ChunkComponent<'_>>,
key: &mut String,
split_context: &mut SplitContext<'_>,
) -> Result<()> {
let components = split_context
.min_component_chunk_size
.and_then(|min_component_chunk_size| {
split_into_component_chunks(components, min_component_chunk_size)
})
.unwrap_or_default();
let mut component_chunks = Vec::with_capacity(components.len());
for (component_items, component_batch_groups) in components {
component_chunks.push(
......
use std::{borrow::Cow, collections::BinaryHeap, hash::BuildHasherDefault, mem::take};
use anyhow::{Context, Result, bail};
use rustc_hash::{FxHashMap, FxHashSet, FxHasher};
use rustc_hash::{FxHashMap, FxHasher};
use smallvec::SmallVec;
use tracing::{Instrument, field::Empty};
use turbo_bitset::Bitset;
use turbo_prehash::BuildHasherExt;
use turbo_tasks::{FxIndexMap, FxIndexSet, MappedReadRef, ReadRef, ResolvedVc, TryJoinIterExt, Vc};
use turbo_rcstr::RcStr;
use turbo_tasks::{
FxIndexMap, FxIndexSet, MappedReadRef, ReadRef, ResolvedVc, TryJoinIterExt, ValueToString, Vc,
};
use crate::{
chunk::{
ChunkItemBatchGroup, ChunkItemBatchWithAsyncModuleInfo,
ChunkItemOrBatchWithAsyncModuleInfo, ChunkItemWithAsyncModuleInfo, ChunkingConfig,
ChunkItem, ChunkItemBatchGroup, ChunkItemBatchWithAsyncModuleInfo,
ChunkItemWithAsyncModuleInfo, ChunkingConfig,
chunking::{
ChunkItemOrBatchWithInfo, ComponentChunkItems, SplitContext,
ChunkComponent, ChunkItemOrBatchWithInfo, SplitContext,
deterministic_grouping::deterministic_grouping, dev::expand_batches, make_chunk,
},
},
......@@ -126,7 +129,10 @@ pub async fn make_production_chunks(
grouped_chunk_items.entry(key).or_default().batch_group = Some(batch_group);
}
let &ChunkingConfig {
// Size limits are made consistent first, e.g. `max_merge_chunk_size` is limited to
// `max_chunk_size`, so chunks bigger than `max_chunk_size` never become merge candidates.
let chunking_config = chunking_config.normalized();
let ChunkingConfig {
min_chunk_size,
max_chunk_count_per_group,
max_merge_chunk_size,
......@@ -134,8 +140,6 @@ pub async fn make_production_chunks(
first_page_load_priority,
priority_boost_percent,
request_cost,
generate_component_chunks,
min_component_chunk_size,
..
} = chunking_config;
......@@ -152,6 +156,7 @@ pub async fn make_production_chunks(
group.batch_group.into_iter().collect(),
Vec::new(),
size,
min_chunk_size,
max_chunk_size,
&mut split_context,
)
......@@ -196,6 +201,8 @@ pub async fn make_production_chunks(
// Determine chunk to merge
loop {
if let Some(smallest) = heap.peek() {
// Chunks bigger than `max_chunk_size` are also bigger than
// `max_merge_chunk_size` (normalized), so they are never merged.
let chunk_over_limit =
max_merge_chunk_size != 0 && smallest.size > max_merge_chunk_size;
if chunk_over_limit {
......@@ -303,6 +310,10 @@ pub async fn make_production_chunks(
if overlap < 1 {
continue;
}
// Merging must not create chunks bigger than `max_chunk_size`
if max_chunk_size != 0 && candidate.size + other.size > max_chunk_size {
continue;
}
// If the candidate is already big enough, avoid shrinking the sharing
if is_big_candidate && overlap != candidate.chunk_groups_len() {
continue;
......@@ -557,19 +568,16 @@ pub async fn make_production_chunks(
}
span.record("merge_iterations", iterations);
let mut remained_size = 0;
let mut remained_chunk_items = Vec::new();
let mut remained_batch_groups = FxIndexSet::default();
let mut remained_components = Vec::new();
for MergeCandidate {
let mut remained = Vec::new();
for candidate in chunks_to_merge.into_iter() {
if candidate.size > merge_threshold {
let MergeCandidate {
size,
chunk_items,
batch_groups,
chunk_groups,
components,
} in chunks_to_merge.into_iter()
{
if size > merge_threshold {
} = candidate;
heap.push(ChunkCandidate {
size,
chunk_items,
......@@ -578,16 +586,36 @@ pub async fn make_production_chunks(
components,
});
} else {
remained.push(candidate);
}
}
// Left-over chunks are merged together forming the remained chunk(s), which include
// all modules that are not sharable. When they are bigger than `max_chunk_size`
// together, they are grouped deterministically into multiple remained chunks.
for group in
group_remained_candidates(remained, min_chunk_size, max_chunk_size).await?
{
let mut remained_size = 0;
let mut remained_chunk_items = Vec::new();
let mut remained_batch_groups = FxIndexSet::default();
let mut remained_components = Vec::new();
for MergeCandidate {
size,
chunk_items,
batch_groups,
components,
..
} in group
{
remained_size += size;
remained_chunk_items.extend(chunk_items);
remained_batch_groups.extend(batch_groups);
remained_components.extend(components);
}
if remained_chunk_items.is_empty() {
continue;
}
// Left-over chunks are merged together forming the remained chunk, which includes
// all modules that are not sharable
if !remained_chunk_items.is_empty() {
heap.push(ChunkCandidate {
size: remained_size,
chunk_items: remained_chunk_items,
......@@ -610,18 +638,15 @@ pub async fn make_production_chunks(
} in heap.into_iter()
{
total_size += size;
// Merged chunks also emit their constituent components as referenced "module
// chunks" for cache-aware loading; a plain chunk passes no
// components.
let components = generate_component_chunks
.then(|| split_into_component_chunks(components, min_component_chunk_size))
.flatten()
.unwrap_or_default();
// Only chunks that were not merged can be bigger than `max_chunk_size`, since
// merging respects it. Merged chunks also emit their components as component
// chunks when enabled.
make_size_limited_chunk(
chunk_items,
batch_groups.into_vec(),
components,
size,
min_chunk_size,
max_chunk_size,
&mut split_context,
)
......@@ -636,17 +661,83 @@ pub async fn make_production_chunks(
.await
}
/// Groups the left-over merge candidates that form the remained chunk(s). This is a single group,
/// unless they are bigger than `max_chunk_size` together. Then they are grouped deterministically,
/// keyed by the smallest module identifier of each candidate, see [`deterministic_grouping`].
/// Candidates are never split, so their components are kept.
async fn group_remained_candidates<'l>(
remained: Vec<MergeCandidate<'l>>,
min_chunk_size: usize,
max_chunk_size: usize,
) -> Result<Vec<Vec<MergeCandidate<'l>>>> {
let total_size = remained
.iter()
.map(|candidate| candidate.size)
.sum::<usize>();
if remained.is_empty() {
return Ok(Vec::new());
}
if max_chunk_size == 0 || total_size <= max_chunk_size {
return Ok(vec![remained]);
}
let keyed = remained
.into_iter()
.map(async |candidate| {
let key = smallest_module_identifier(&candidate.chunk_items).await?;
let size = candidate.size;
Ok((candidate, key, size))
})
.try_join()
.await?;
Ok(deterministic_grouping(
keyed,
min_chunk_size,
max_chunk_size,
))
}
/// Returns the smallest module identifier of the chunk items, including the chunk items in batches.
async fn smallest_module_identifier(chunk_items: &[&ChunkItemOrBatchWithInfo]) -> Result<RcStr> {
let mut smallest: Option<RcStr> = None;
for item in chunk_items {
match item {
ChunkItemOrBatchWithInfo::ChunkItem { asset_ident, .. } => {
if smallest
.as_ref()
.is_none_or(|smallest| asset_ident < smallest)
{
smallest = Some(asset_ident.clone());
}
}
ChunkItemOrBatchWithInfo::Batch { batch, .. } => {
for chunk_item in &batch.await?.chunk_items {
let asset_ident = chunk_item.chunk_item.asset_ident().to_string().await?;
if smallest
.as_ref()
.is_none_or(|smallest| &*asset_ident < smallest)
{
smallest = Some((*asset_ident).clone());
}
}
}
}
}
Ok(smallest.unwrap_or_default())
}
/// Creates a chunk from `chunk_items` (with a total size of `size`), or several chunks when `size`
/// is bigger than `max_chunk_size` (unless that is `0`).
///
/// Oversized chunks are split deterministically by the module identifiers of their chunk items, see
/// [`deterministic_grouping`]. Batches are expanded into their chunk items for that. The split
/// chunks get the batch groups whose chunk items they fully contain, and no component chunks.
/// Oversized chunks are split deterministically by the module identifiers of their chunk items,
/// preferring chunks of at least `min_chunk_size`, see [`deterministic_grouping`]. Batches are
/// expanded into their chunk items for that. Since only chunks that were not merged are oversized,
/// they have no components. The split chunks get no batch groups, which are only an optimization.
async fn make_size_limited_chunk<'l>(
chunk_items: Vec<&'l ChunkItemOrBatchWithInfo>,
batch_groups: Vec<ResolvedVc<ChunkItemBatchGroup>>,
components: Vec<ComponentChunkItems<'l>>,
components: Vec<ChunkComponent<'l>>,
size: usize,
min_chunk_size: usize,
max_chunk_size: usize,
split_context: &mut SplitContext<'_>,
) -> Result<()> {
......@@ -676,48 +767,10 @@ async fn make_size_limited_chunk<'l>(
ChunkItemOrBatchWithInfo::Batch { .. } => bail!("batches should have been expanded"),
})
.collect::<Result<Vec<_>>>()?;
let parts = deterministic_grouping(keyed_items, max_chunk_size);
// The chunk items of each batch group, to find the split chunks that fully contain them.
let batch_group_chunk_items = batch_groups
.iter()
.map(async |&batch_group| {
let mut chunk_items = FxHashSet::default();
for item in &batch_group.await?.items {
match item {
ChunkItemOrBatchWithAsyncModuleInfo::ChunkItem(chunk_item) => {
chunk_items.insert(*chunk_item);
}
ChunkItemOrBatchWithAsyncModuleInfo::Batch(batch) => {
chunk_items.extend(batch.await?.chunk_items.iter().copied());
}
}
}
Ok((batch_group, chunk_items))
})
.try_join()
.await?;
for part in parts {
let part_batch_groups = if batch_group_chunk_items.is_empty() {
Vec::new()
} else {
let part_chunk_items = part
.iter()
.filter_map(|item| match item {
ChunkItemOrBatchWithInfo::ChunkItem { chunk_item, .. } => Some(*chunk_item),
ChunkItemOrBatchWithInfo::Batch { .. } => None,
})
.collect::<FxHashSet<_>>();
batch_group_chunk_items
.iter()
.filter(|(_, chunk_items)| chunk_items.is_subset(&part_chunk_items))
.map(|(batch_group, _)| *batch_group)
.collect()
};
for part in deterministic_grouping(keyed_items, min_chunk_size, max_chunk_size) {
make_chunk(
part,
part_batch_groups,
Vec::new(),
Vec::new(),
&mut String::new(),
split_context,
......@@ -727,15 +780,6 @@ async fn make_size_limited_chunk<'l>(
Ok(())
}
/// One original (pre-merge) atomic chunk group. A [`ChunkCandidate`]/[`MergeCandidate`] tracks the
/// components it was merged from so the emitted merged chunk can also expose them as individual
/// "module chunks" for cache-aware loading at runtime.
struct ChunkComponent<'l> {
size: usize,
chunk_items: Vec<&'l ChunkItemOrBatchWithInfo>,
batch_groups: SmallVec<[ResolvedVc<ChunkItemBatchGroup>; 1]>,
}
struct ChunkCandidate<'l> {
size: usize,
chunk_items: Vec<&'l ChunkItemOrBatchWithInfo>,
......@@ -804,45 +848,6 @@ impl PartialEq for MergeCandidate<'_> {
}
}
fn split_into_component_chunks<'l>(
components: Vec<ChunkComponent<'l>>,
min_component_chunk_size: usize,
) -> Option<Vec<ComponentChunkItems<'l>>> {
// A single original part can't benefit from splitting.
if components.len() <= 1 {
return None;
}
let mut component_chunks: Vec<ComponentChunkItems<'l>> = Vec::new();
let mut remainder_items: Vec<&'l ChunkItemOrBatchWithInfo> = Vec::new();
let mut remainder_batch_groups = FxIndexSet::default();
for part in components {
if part.size >= min_component_chunk_size {
component_chunks.push((part.chunk_items, part.batch_groups.into_vec()));
} else {
// we create a "remainder" chunk with smaller component chunks so that
// an entire chunk can be loaded by loading all of its component chunks
remainder_items.extend(part.chunk_items);
remainder_batch_groups.extend(part.batch_groups);
}
}
// TODO (@sampoder): handle the case where there are many the component chunks
// that are only slightly smaller than the min_component_chunk_size. this may
// mean that there is no benefit to component chunking.
if !remainder_items.is_empty() {
component_chunks.push((
remainder_items,
remainder_batch_groups.into_iter().collect(),
));
}
// A split is only worthwhile if it yields more than one component chunk.
if component_chunks.len() <= 1 {
None
} else {
Some(component_chunks)
}
}
fn overlap(chunk_groups: &Option<Cow<'_, Bitset>>, chunk_groups2: &Option<Cow<'_, Bitset>>) -> u64 {
if let (Some(chunk_groups), Some(chunk_groups2)) = (chunk_groups, chunk_groups2) {
chunk_groups.intersection_len(chunk_groups2) as u64
......
......@@ -248,14 +248,22 @@ pub struct ChunkingConfig {
/// Never merges chunks bigger than this size with other chunks.
/// This makes sure that code in big chunks is not duplicated in multiple chunks.
/// `0` means no limit. When `max_chunk_size` is set, this is limited to `max_chunk_size` (see
/// [`ChunkingConfig::normalized`]).
pub max_merge_chunk_size: usize,
/// Best-effort upper bound on the estimated size of a chunk. After merging, chunks bigger than
/// this are split deterministically (by sorting their chunk items by module identifier) into
/// chunks that are not bigger than this size. Splitting may create chunks smaller than
/// `min_chunk_size` and more chunks than `max_chunk_count_per_group`. Split merged chunks do
/// not emit component chunks. Only a single chunk item bigger than this size can still
/// produce a bigger chunk. `0` disables splitting. Not used for style chunk types.
/// Best-effort upper bound on the estimated size of a chunk. `0` disables the limit. Not used
/// for style chunk types.
///
/// Merging never creates chunks bigger than this size, and chunks bigger than this size are
/// never merged. Chunks that are too big on their own are split deterministically (by sorting
/// their chunk items by module identifier) into chunks that are not bigger than this size,
/// preferring chunks of at least `min_chunk_size`. To stay below the limit, chunks may be
/// smaller than `min_chunk_size` and there may be more chunks than
/// `max_chunk_count_per_group`. Only a single chunk item bigger than this size can still
/// produce a bigger chunk.
///
/// This is raised to at least `3 * min_chunk_size` (see [`ChunkingConfig::normalized`]).
pub max_chunk_size: usize,
/// When enabled, a merged chunk also emits its constituent component chunks (referenced,
......@@ -292,6 +300,32 @@ pub struct ChunkingConfig {
#[turbo_tasks::value(transparent)]
pub struct ChunkingConfigs(FxHashMap<ResolvedVc<Box<dyn ChunkType>>, ChunkingConfig>);
impl ChunkingConfig {
/// Returns this config with consistent size limits. When `max_chunk_size` is set (not `0`):
///
/// 1. `max_chunk_size` is raised to `3 * min_chunk_size` if it is smaller, so that chunks can
/// be split into chunks of at least `min_chunk_size`.
/// 2. `max_merge_chunk_size` is lowered to `max_chunk_size` if it is bigger or `0` (no limit),
/// since chunks bigger than `max_chunk_size` are never merged anyway.
///
/// The production chunking algorithm always uses the normalized config. Compare with the
/// original config to find out whether anything was adjusted.
pub fn normalized(&self) -> Self {
let mut config = self.clone();
if config.max_chunk_size != 0 {
config.max_chunk_size = config
.max_chunk_size
.max(config.min_chunk_size.saturating_mul(3));
if config.max_merge_chunk_size == 0
|| config.max_merge_chunk_size > config.max_chunk_size
{
config.max_merge_chunk_size = config.max_chunk_size;
}
}
config
}
}
/// turbopack-browser needs to know the original
/// source of the hmr chunk list to properly map to a
/// EcmascriptDevChunkListSource and provide the correct
......@@ -897,3 +931,62 @@ fn chunk_group_assets(
)
.output_assets_with_referenced()
}
#[cfg(test)]
mod tests {
use super::ChunkingConfig;
fn config(min: usize, merge: usize, max: usize) -> ChunkingConfig {
ChunkingConfig {
min_chunk_size: min,
max_merge_chunk_size: merge,
max_chunk_size: max,
..Default::default()
}
}
fn limits(config: &ChunkingConfig) -> (usize, usize, usize) {
(
config.min_chunk_size,
config.max_merge_chunk_size,
config.max_chunk_size,
)
}
#[test]
fn normalized_keeps_valid_configs() {
let valid = config(50_000, 200_000, 1_000_000);
assert_eq!(valid.normalized(), valid);
// Exactly at the limits.
let valid = config(100, 300, 300);
assert_eq!(valid.normalized(), valid);
}
#[test]
fn normalized_ignores_disabled_max_chunk_size() {
let disabled = config(50_000, 0, 0);
assert_eq!(disabled.normalized(), disabled);
let disabled = config(50_000, 200_000, 0);
assert_eq!(disabled.normalized(), disabled);
}
#[test]
fn normalized_raises_max_chunk_size() {
assert_eq!(limits(&config(100, 200, 200).normalized()), (100, 200, 300));
}
#[test]
fn normalized_lowers_max_merge_chunk_size() {
assert_eq!(limits(&config(10, 500, 200).normalized()), (10, 200, 200));
// `0` means no limit, which is bigger than any `max_chunk_size`.
assert_eq!(limits(&config(10, 0, 200).normalized()), (10, 200, 200));
}
#[test]
fn normalized_lowers_max_merge_chunk_size_to_raised_max_chunk_size() {
assert_eq!(
limits(&config(100, 1_000, 200).normalized()),
(100, 300, 300)
);
}
}
......@@ -300,6 +300,9 @@ struct TestOptions {
/// `max_chunk_size` of the ecmascript chunking config when `production_chunking` is enabled.
#[serde(default)]
max_chunk_size: usize,
/// Overrides `min_chunk_size` (default `2000`) when `production_chunking` is enabled.
#[serde(default)]
min_chunk_size: Option<usize>,
#[serde(default)]
global_module_ids: bool,
/// Assign numeric module ids, as production builds do, instead of the
......@@ -338,6 +341,7 @@ impl Default for TestOptions {
minify: false,
production_chunking: false,
max_chunk_size: 0,
min_chunk_size: None,
global_module_ids: false,
numeric_module_ids: false,
side_effect_free_packages: Vec::new(),
......@@ -665,7 +669,7 @@ async fn run_test_operation(prepared_test: ResolvedVc<PreparedTest>) -> Result<V
.chunking_config(
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ChunkingConfig {
min_chunk_size: 2_000,
min_chunk_size: options.min_chunk_size.unwrap_or(2_000),
max_chunk_count_per_group: 40,
max_merge_chunk_size: 200_000,
max_chunk_size: options.max_chunk_size,
......
{
"productionChunking": true,
"minChunkSize": 800,
"maxChunkSize": 2500,
"scopeHoisting": false
}
......@@ -114,6 +114,10 @@ struct SnapshotOptions {
/// Overrides `min_chunk_size` (default `2000`) when `production_chunking` is enabled.
#[serde(default)]
min_chunk_size: Option<usize>,
/// `request_cost` of the ecmascript chunking config when `production_chunking` is enabled.
/// A tiny request cost makes merging chunks of different chunk groups unbeneficial.
#[serde(default)]
request_cost: Option<u64>,
/// Overrides `max_chunk_count_per_group` (default `40`) when `production_chunking` is enabled.
#[serde(default)]
max_chunk_count_per_group: Option<usize>,
......@@ -172,6 +176,7 @@ impl Default for SnapshotOptions {
production_chunking: false,
max_chunk_size: 0,
min_chunk_size: None,
request_cost: None,
max_chunk_count_per_group: None,
generate_component_chunks: false,
min_component_chunk_size: 0,
......@@ -594,6 +599,7 @@ async fn run_test_operation(resource: RcStr) -> Result<Vc<FileSystemPath>> {
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ChunkingConfig {
min_chunk_size: options.min_chunk_size.unwrap_or(2_000),
request_cost: options.request_cost,
max_chunk_count_per_group: options
.max_chunk_count_per_group
.unwrap_or(40),
......@@ -646,6 +652,7 @@ async fn run_test_operation(resource: RcStr) -> Result<Vc<FileSystemPath>> {
Vc::<EcmascriptChunkType>::default().to_resolved().await?,
ChunkingConfig {
min_chunk_size: options.min_chunk_size.unwrap_or(2_000),
request_cost: options.request_cost,
max_chunk_count_per_group: options
.max_chunk_count_per_group
.unwrap_or(40),
......
......@@ -2,5 +2,6 @@
"minifyType": "NoMinify",
"runtime": "NodeJs",
"productionChunking": true,
"minChunkSize": 800,
"maxChunkSize": 2500
}
// Each shared module is used by a different pair of pages, so each one ends up in its own small
// chunk that gets merged with the others. The merged chunk is bigger than `maxChunkSize` and is
// split again, without component chunks.
// chunk that gets merged with the other one of that page. The merged chunk is not bigger than
// `maxChunkSize`, and emits its components as component chunks.
import('./pages/p1.js').then(({ p1 }) => console.log(p1))
import('./pages/p2.js').then(({ p2 }) => console.log(p2))
import('./pages/p3.js').then(({ p3 }) => console.log(p3))
......@@ -3,5 +3,6 @@
"productionChunking": true,
"generateComponentChunks": true,
"minComponentChunkSize": 0,
"maxChunkSize": 1000
"minChunkSize": 600,
"maxChunkSize": 1800
}
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
"output/1ece_tests_snapshot_basic_max_chunk_size_component_chunks_input_index_0bkzse36kpcm6.js",
{"otherChunks":["output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_index_0s5d05z3do_gt.js","output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_pages_0tayzpyex8jzl._.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/index.js [test] (ecmascript)"]}
"output/1ece_tests_snapshot_basic_max_chunk_size_component_chunks_input_index_1wd7fw682v4sl.js",
{"otherChunks":["output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_pages_1h0h8os30v5o1._.js","output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_index_0s5d05z3do_gt.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/index.js [test] (ecmascript)"]}
]);
// Dummy runtime
\ No newline at end of file
......@@ -2,8 +2,8 @@
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
// Each shared module is used by a different pair of pages, so each one ends up in its own small
// chunk that gets merged with the others. The merged chunk is bigger than `maxChunkSize` and is
// split again, without component chunks.
// chunk that gets merged with the other one of that page. The merged chunk is not bigger than
// `maxChunkSize`, and emits its components as component chunks.
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/pages/p1.js [test] (ecmascript, async loader)").then(({ p1 })=>console.log(p1));
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/pages/p2.js [test] (ecmascript, async loader)").then(({ p2 })=>console.log(p2));
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/pages/p3.js [test] (ecmascript, async loader)").then(({ p3 })=>console.log(p3));
......
......@@ -2,5 +2,5 @@
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/index.js"],"sourcesContent":["// Each shared module is used by a different pair of pages, so each one ends up in its own small\n// chunk that gets merged with the others. The merged chunk is bigger than `maxChunkSize` and is\n// split again, without component chunks.\nimport('./pages/p1.js').then(({ p1 }) => console.log(p1))\nimport('./pages/p2.js').then(({ p2 }) => console.log(p2))\nimport('./pages/p3.js').then(({ p3 }) => console.log(p3))\n"],"names":["then","p1","console","log","p2","p3"],"mappings":"AAAA,gGAAgG;AAChG,gGAAgG;AAChG,yCAAyC;AACzC,+KAAwBA,IAAI,CAAC,CAAC,EAAEC,EAAE,EAAE,GAAKC,QAAQC,GAAG,CAACF;AACrD,+KAAwBD,IAAI,CAAC,CAAC,EAAEI,EAAE,EAAE,GAAKF,QAAQC,GAAG,CAACC;AACrD,+KAAwBJ,IAAI,CAAC,CAAC,EAAEK,EAAE,EAAE,GAAKH,QAAQC,GAAG,CAACE"}}]
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/index.js"],"sourcesContent":["// Each shared module is used by a different pair of pages, so each one ends up in its own small\n// chunk that gets merged with the other one of that page. The merged chunk is not bigger than\n// `maxChunkSize`, and emits its components as component chunks.\nimport('./pages/p1.js').then(({ p1 }) => console.log(p1))\nimport('./pages/p2.js').then(({ p2 }) => console.log(p2))\nimport('./pages/p3.js').then(({ p3 }) => console.log(p3))\n"],"names":["then","p1","console","log","p2","p3"],"mappings":"AAAA,gGAAgG;AAChG,8FAA8F;AAC9F,gEAAgE;AAChE,+KAAwBA,IAAI,CAAC,CAAC,EAAEC,EAAE,EAAE,GAAKC,QAAQC,GAAG,CAACF;AACrD,+KAAwBD,IAAI,CAAC,CAAC,EAAEI,EAAE,EAAE,GAAKF,QAAQC,GAAG,CAACC;AACrD,+KAAwBJ,IAAI,CAAC,CAAC,EAAEK,EAAE,EAAE,GAAKH,QAAQC,GAAG,CAACE"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_pages_0tayzpyex8jzl._.js",
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_pages_1h0h8os30v5o1._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/pages/p1.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_pages_p1_060cu0zm-5axk.js",
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_0g3h0wl7t247t._.js",
"moduleChunks": [
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_shared_x_0g1-ao1noy0o6.js",
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_shared_y_1kkyfx9emckum.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/pages/p1.js [test] (ecmascript)");
});
......@@ -16,8 +21,13 @@ __turbopack_context__.v((parentImport) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_pages_p2_0i-hrlg8q0opu.js",
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_1yn2c4hd-xgwn._.js",
"moduleChunks": [
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_shared_x_0g1-ao1noy0o6.js",
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_shared_z_11lj79hlokc-g.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/pages/p2.js [test] (ecmascript)");
});
......@@ -28,8 +38,13 @@ __turbopack_context__.v((parentImport) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_pages_p3_19pgvrw3i3jnq.js",
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_1y_pfj1ekiq7p._.js",
"moduleChunks": [
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_shared_y_1kkyfx9emckum.js",
"output/0p5q_snapshot_basic_max_chunk_size_component_chunks_input_shared_z_11lj79hlokc-g.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/pages/p3.js [test] (ecmascript)");
});
......
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_0g3h0wl7t247t._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/x.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
// Padding so that the shared modules together are bigger than `maxChunkSize`.
__turbopack_context__.s([
"x",
()=>x
]);
const x = 'x: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' + 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' + 'mollit anim id est laborum.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/y.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
// Padding so that the shared modules together are bigger than `maxChunkSize`.
__turbopack_context__.s([
"y",
()=>y
]);
const y = 'y: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' + 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' + 'mollit anim id est laborum.';
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_0g3h0wl7t247t._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/x.js"],"sourcesContent":["// Padding so that the shared modules together are bigger than `maxChunkSize`.\nexport const x =\n 'x: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' +\n 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' +\n 'mollit anim id est laborum.'\n"],"names":["x"],"mappings":"AAAA,8EAA8E;;;;;AACvE,MAAMA,IACX,uFACA,wFACA,2FACA,4FACA,wFACA"}},
{"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/y.js"],"sourcesContent":["// Padding so that the shared modules together are bigger than `maxChunkSize`.\nexport const y =\n 'y: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' +\n 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' +\n 'mollit anim id est laborum.'\n"],"names":["y"],"mappings":"AAAA,8EAA8E;;;;;AACvE,MAAMA,IACX,uFACA,wFACA,2FACA,4FACA,wFACA"}}]
}
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_1y_pfj1ekiq7p._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/y.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
// Padding so that the shared modules together are bigger than `maxChunkSize`.
__turbopack_context__.s([
"y",
()=>y
]);
const y = 'y: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' + 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' + 'mollit anim id est laborum.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/z.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
// Padding so that the shared modules together are bigger than `maxChunkSize`.
__turbopack_context__.s([
"z",
()=>z
]);
const z = 'z: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' + 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' + 'mollit anim id est laborum.';
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_1y_pfj1ekiq7p._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/y.js"],"sourcesContent":["// Padding so that the shared modules together are bigger than `maxChunkSize`.\nexport const y =\n 'y: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' +\n 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' +\n 'mollit anim id est laborum.'\n"],"names":["y"],"mappings":"AAAA,8EAA8E;;;;;AACvE,MAAMA,IACX,uFACA,wFACA,2FACA,4FACA,wFACA"}},
{"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/z.js"],"sourcesContent":["// Padding so that the shared modules together are bigger than `maxChunkSize`.\nexport const z =\n 'z: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' +\n 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' +\n 'mollit anim id est laborum.'\n"],"names":["z"],"mappings":"AAAA,8EAA8E;;;;;AACvE,MAAMA,IACX,uFACA,wFACA,2FACA,4FACA,wFACA"}}]
}
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_1yn2c4hd-xgwn._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/x.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
// Padding so that the shared modules together are bigger than `maxChunkSize`.
__turbopack_context__.s([
"x",
()=>x
]);
const x = 'x: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' + 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' + 'mollit anim id est laborum.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/z.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
// Padding so that the shared modules together are bigger than `maxChunkSize`.
__turbopack_context__.s([
"z",
()=>z
]);
const z = 'z: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' + 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' + 'mollit anim id est laborum.';
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_component_chunks_input_shared_1yn2c4hd-xgwn._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/x.js"],"sourcesContent":["// Padding so that the shared modules together are bigger than `maxChunkSize`.\nexport const x =\n 'x: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' +\n 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' +\n 'mollit anim id est laborum.'\n"],"names":["x"],"mappings":"AAAA,8EAA8E;;;;;AACvE,MAAMA,IACX,uFACA,wFACA,2FACA,4FACA,wFACA"}},
{"offset": {"line": 14, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_component_chunks/input/shared/z.js"],"sourcesContent":["// Padding so that the shared modules together are bigger than `maxChunkSize`.\nexport const z =\n 'z: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ' +\n 'Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt ' +\n 'mollit anim id est laborum.'\n"],"names":["z"],"mappings":"AAAA,8EAA8E;;;;;AACvE,MAAMA,IACX,uFACA,wFACA,2FACA,4FACA,wFACA"}}]
}
\ No newline at end of file
export const a1 =
'a1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +
'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +
'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'
export const a2 =
'a2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +
'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +
'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'
export const a3 =
'a3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +
'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +
'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'
export const b1 =
'b1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +
'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +
'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'
export const b2 =
'b2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +
'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +
'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'
export const b3 =
'b3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +
'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +
'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'
// `page.js` uses all shared modules, and each shared module is also used by one other page. So each
// shared module is its own small chunk in the chunk group of `page.js`, which is not merged with the
// others (merging is not beneficial with the tiny request cost). They all end up in the remained
// chunk, but together they are bigger than `maxChunkSize`, so they form multiple remained chunks
// instead, split between the `a` and `b` directories. Each remained chunk is a merged chunk and
// emits its components as component chunks.
import('./page.js').then(({ page }) => console.log(page))
import('./other/a1.js').then(({ other }) => console.log(other))
import('./other/a2.js').then(({ other }) => console.log(other))
import('./other/a3.js').then(({ other }) => console.log(other))
import('./other/b1.js').then(({ other }) => console.log(other))
import('./other/b2.js').then(({ other }) => console.log(other))
import('./other/b3.js').then(({ other }) => console.log(other))
import { a1 } from './a/a1.js'
import { a2 } from './a/a2.js'
import { a3 } from './a/a3.js'
import { b1 } from './b/b1.js'
import { b2 } from './b/b2.js'
import { b3 } from './b/b3.js'
export const page = [a1, a2, a3, b1, b2, b3]
{
"minifyType": "NoMinify",
"productionChunking": true,
"generateComponentChunks": true,
"minComponentChunkSize": 0,
"requestCost": 1,
"minChunkSize": 600,
"maxChunkSize": 1800
}
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([
"output/1ece_tests_snapshot_basic_max_chunk_size_remainder_input_index_1cm__pg6sinpy.js",
{"otherChunks":["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_0p5un9tqr6bdk._.js","output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_index_09chyqc0c2tyl.js"],"runtimeModuleIds":["[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/index.js [test] (ecmascript)"]}
]);
// Dummy runtime
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_09bb5-3441wrw._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a2",
()=>a2
]);
const a2 = 'a2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a2$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a2$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a2"];
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_09bb5-3441wrw._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js"],"sourcesContent":["export const a2 =\n 'a2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a2"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a2.js"],"sourcesContent":["import { a2 } from '../a/a2.js'\n\nexport const other = a2\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_0jl0q31fvtmk5._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a1",
()=>a1
]);
const a1 = 'a1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a1$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a1$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a1"];
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_0jl0q31fvtmk5._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js"],"sourcesContent":["export const a1 =\n 'a1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a1"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a1.js"],"sourcesContent":["import { a1 } from '../a/a1.js'\n\nexport const other = a1\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_0p5un9tqr6bdk._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a1.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_0jl0q31fvtmk5._.js",
"moduleChunks": [
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a1_1g5f-knw7kgy1.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a1_0les6wf8lnk12.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a1.js [test] (ecmascript)");
});
});
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a2.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_09bb5-3441wrw._.js",
"moduleChunks": [
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a2_1oqvu1_z68nde.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a2_08yvjkj2t6wfl.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a2.js [test] (ecmascript)");
});
});
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a3.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1wywpo0-r260m._.js",
"moduleChunks": [
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a3_12dz688w30tp8.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a3_0-0t96g_64lfv.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a3.js [test] (ecmascript)");
});
});
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b1.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1fp0dcti1pdfk._.js",
"moduleChunks": [
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b1_1qz_3i--zs4w8.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b1_1h-07lcqoz1d7.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b1.js [test] (ecmascript)");
});
});
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b2.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1kzpyo05wr6ja._.js",
"moduleChunks": [
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b2_1pi9ma63yuz-w.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b2_13fdqcd9gzg78.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b2.js [test] (ecmascript)");
});
});
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b3.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_18v0oqdeu7xj1._.js",
"moduleChunks": [
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b3_0-_uwy580c_zk.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b3_0lf80qd958q5p.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b3.js [test] (ecmascript)");
});
});
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/page.js [test] (ecmascript, async loader)", ((__turbopack_context__) => {
__turbopack_context__.v((parentImport) => {
return Promise.all([
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_1y49iszuenp5m._.js",
"moduleChunks": [
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a1_1g5f-knw7kgy1.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a2_1oqvu1_z68nde.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a3_12dz688w30tp8.js"
]
},
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_page_0rqm75iukhb5l.js",
{
"path": "output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_0g458p-23ifnz._.js",
"moduleChunks": [
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b1_1qz_3i--zs4w8.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b2_1pi9ma63yuz-w.js",
"output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b3_0-_uwy580c_zk.js"
]
}
].map((chunk) => __turbopack_context__.l(chunk))).then(() => {
return parentImport("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/page.js [test] (ecmascript)");
});
});
}),
]);
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_18v0oqdeu7xj1._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b3",
()=>b3
]);
const b3 = 'b3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b3$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b3$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b3"];
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_18v0oqdeu7xj1._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js"],"sourcesContent":["export const b3 =\n 'b3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b3"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b3.js"],"sourcesContent":["import { b3 } from '../b/b3.js'\n\nexport const other = b3\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1fp0dcti1pdfk._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b1",
()=>b1
]);
const b1 = 'b1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b1$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b1$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b1"];
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1fp0dcti1pdfk._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js"],"sourcesContent":["export const b1 =\n 'b1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b1"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b1.js"],"sourcesContent":["import { b1 } from '../b/b1.js'\n\nexport const other = b1\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1kzpyo05wr6ja._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b2",
()=>b2
]);
const b2 = 'b2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b2$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b2$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b2"];
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1kzpyo05wr6ja._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js"],"sourcesContent":["export const b2 =\n 'b2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b2"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b2.js"],"sourcesContent":["import { b2 } from '../b/b2.js'\n\nexport const other = b2\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1wywpo0-r260m._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a3",
()=>a3
]);
const a3 = 'a3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a3$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a3$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a3"];
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_1wywpo0-r260m._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js"],"sourcesContent":["export const a3 =\n 'a3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a3"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a3.js"],"sourcesContent":["import { a3 } from '../a/a3.js'\n\nexport const other = a3\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_1y49iszuenp5m._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a1",
()=>a1
]);
const a1 = 'a1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a2",
()=>a2
]);
const a2 = 'a2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a3",
()=>a3
]);
const a3 = 'a3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_1y49iszuenp5m._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js"],"sourcesContent":["export const a1 =\n 'a1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a1"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js"],"sourcesContent":["export const a2 =\n 'a2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a2"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 22, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js"],"sourcesContent":["export const a3 =\n 'a3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a3"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a1_1g5f-knw7kgy1.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a1",
()=>a1
]);
const a1 = 'a1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a1_1g5f-knw7kgy1.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js"],"sourcesContent":["export const a1 =\n 'a1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a1"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a2_1oqvu1_z68nde.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a2",
()=>a2
]);
const a2 = 'a2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a2_1oqvu1_z68nde.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js"],"sourcesContent":["export const a2 =\n 'a2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a2"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a3_12dz688w30tp8.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"a3",
()=>a3
]);
const a3 = 'a3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_a_a3_12dz688w30tp8.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js"],"sourcesContent":["export const a3 =\n 'a3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["a3"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}}]
}
\ No newline at end of file
(()=>{"use strict";(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_0g458p-23ifnz._.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b1",
()=>b1
]);
const b1 = 'b1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b2",
()=>b2
]);
const b2 = 'b2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b3",
()=>b3
]);
const b3 = 'b3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
]);})()
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_0g458p-23ifnz._.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js"],"sourcesContent":["export const b1 =\n 'b1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b1"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js"],"sourcesContent":["export const b2 =\n 'b2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b2"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}},
{"offset": {"line": 22, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js"],"sourcesContent":["export const b3 =\n 'b3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b3"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b1_1qz_3i--zs4w8.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b1",
()=>b1
]);
const b1 = 'b1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b1_1qz_3i--zs4w8.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js"],"sourcesContent":["export const b1 =\n 'b1: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b1"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b2_1pi9ma63yuz-w.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b2",
()=>b2
]);
const b2 = 'b2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b2_1pi9ma63yuz-w.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js"],"sourcesContent":["export const b2 =\n 'b2: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b2"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b3_0-_uwy580c_zk.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"b3",
()=>b3
]);
const b3 = 'b3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' + 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' + 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' + 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_b_b3_0-_uwy580c_zk.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js"],"sourcesContent":["export const b3 =\n 'b3: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor ' +\n 'incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud ' +\n 'exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +\n 'dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.'\n"],"names":["b3"],"mappings":";;;;AAAO,MAAMA,KACX,wFACA,wFACA,2FACA"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_index_09chyqc0c2tyl.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/index.js [test] (ecmascript)", ((__turbopack_context__, module, exports) => {
// `page.js` uses all shared modules, and each shared module is also used by one other page. So each
// shared module is its own small chunk in the chunk group of `page.js`, which is not merged with the
// others (merging is not beneficial with the tiny request cost). They all end up in the remained
// chunk, but together they are bigger than `maxChunkSize`, so they form multiple remained chunks
// instead, split between the `a` and `b` directories. Each remained chunk is a merged chunk and
// emits its components as component chunks.
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/page.js [test] (ecmascript, async loader)").then(({ page })=>console.log(page));
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a1.js [test] (ecmascript, async loader)").then(({ other })=>console.log(other));
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a2.js [test] (ecmascript, async loader)").then(({ other })=>console.log(other));
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a3.js [test] (ecmascript, async loader)").then(({ other })=>console.log(other));
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b1.js [test] (ecmascript, async loader)").then(({ other })=>console.log(other));
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b2.js [test] (ecmascript, async loader)").then(({ other })=>console.log(other));
__turbopack_context__.A("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b3.js [test] (ecmascript, async loader)").then(({ other })=>console.log(other));
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_index_09chyqc0c2tyl.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/index.js"],"sourcesContent":["// `page.js` uses all shared modules, and each shared module is also used by one other page. So each\n// shared module is its own small chunk in the chunk group of `page.js`, which is not merged with the\n// others (merging is not beneficial with the tiny request cost). They all end up in the remained\n// chunk, but together they are bigger than `maxChunkSize`, so they form multiple remained chunks\n// instead, split between the `a` and `b` directories. Each remained chunk is a merged chunk and\n// emits its components as component chunks.\nimport('./page.js').then(({ page }) => console.log(page))\nimport('./other/a1.js').then(({ other }) => console.log(other))\nimport('./other/a2.js').then(({ other }) => console.log(other))\nimport('./other/a3.js').then(({ other }) => console.log(other))\nimport('./other/b1.js').then(({ other }) => console.log(other))\nimport('./other/b2.js').then(({ other }) => console.log(other))\nimport('./other/b3.js').then(({ other }) => console.log(other))\n"],"names":["then","page","console","log","other"],"mappings":"AAAA,oGAAoG;AACpG,qGAAqG;AACrG,iGAAiG;AACjG,iGAAiG;AACjG,gGAAgG;AAChG,4CAA4C;AAC5C,oKAAoBA,IAAI,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKC,QAAQC,GAAG,CAACF;AACnD,wKAAwBD,IAAI,CAAC,CAAC,EAAEI,KAAK,EAAE,GAAKF,QAAQC,GAAG,CAACC;AACxD,wKAAwBJ,IAAI,CAAC,CAAC,EAAEI,KAAK,EAAE,GAAKF,QAAQC,GAAG,CAACC;AACxD,wKAAwBJ,IAAI,CAAC,CAAC,EAAEI,KAAK,EAAE,GAAKF,QAAQC,GAAG,CAACC;AACxD,wKAAwBJ,IAAI,CAAC,CAAC,EAAEI,KAAK,EAAE,GAAKF,QAAQC,GAAG,CAACC;AACxD,wKAAwBJ,IAAI,CAAC,CAAC,EAAEI,KAAK,EAAE,GAAKF,QAAQC,GAAG,CAACC;AACxD,wKAAwBJ,IAAI,CAAC,CAAC,EAAEI,KAAK,EAAE,GAAKF,QAAQC,GAAG,CAACC"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a1_0les6wf8lnk12.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a1$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a1$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a1"];
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a1_0les6wf8lnk12.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a1.js"],"sourcesContent":["import { a1 } from '../a/a1.js'\n\nexport const other = a1\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a2_08yvjkj2t6wfl.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a2$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a2$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a2"];
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a2_08yvjkj2t6wfl.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a2.js"],"sourcesContent":["import { a2 } from '../a/a2.js'\n\nexport const other = a2\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a3_0-0t96g_64lfv.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a3$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a3$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a3"];
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_a3_0-0t96g_64lfv.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/a3.js"],"sourcesContent":["import { a3 } from '../a/a3.js'\n\nexport const other = a3\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b1_1h-07lcqoz1d7.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b1.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b1$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b1$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b1"];
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b1_1h-07lcqoz1d7.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b1.js"],"sourcesContent":["import { b1 } from '../b/b1.js'\n\nexport const other = b1\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b2_13fdqcd9gzg78.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b2.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b2$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b2$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b2"];
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b2_13fdqcd9gzg78.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b2.js"],"sourcesContent":["import { b2 } from '../b/b2.js'\n\nexport const other = b2\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b3_0lf80qd958q5p.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b3.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"other",
()=>other
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b3$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js [test] (ecmascript)");
;
const other = __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b3$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b3"];
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_other_b3_0lf80qd958q5p.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/other/b3.js"],"sourcesContent":["import { b3 } from '../b/b3.js'\n\nexport const other = b3\n"],"names":["other"],"mappings":";;;;AAAA;;AAEO,MAAMA,QAAQ,uNAAE"}}]
}
\ No newline at end of file
(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push(["output/1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_page_0rqm75iukhb5l.js",
"[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/page.js [test] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"page",
()=>page
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a1$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a1.js [test] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a2$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a2.js [test] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a3$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/a/a3.js [test] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b1$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b1.js [test] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b2$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b2.js [test] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b3$2e$js__$5b$test$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/b/b3.js [test] (ecmascript)");
;
;
;
;
;
;
const page = [
__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a1$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a1"],
__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a2$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a2"],
__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$a$2f$a3$2e$js__$5b$test$5d$__$28$ecmascript$29$__["a3"],
__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b1$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b1"],
__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b2$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b2"],
__TURBOPACK__imported__module__$5b$project$5d2f$turbopack$2f$crates$2f$turbopack$2d$tests$2f$tests$2f$snapshot$2f$basic$2f$max_chunk_size_remainder$2f$input$2f$b$2f$b3$2e$js__$5b$test$5d$__$28$ecmascript$29$__["b3"]
];
}),
]);
//# sourceMappingURL=1jsg_tests_snapshot_basic_max_chunk_size_remainder_input_page_0rqm75iukhb5l.js.map
\ No newline at end of file
{
"version": 3,
"sources": [],
"sections": [
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["turbopack:///[project]/turbopack/crates/turbopack-tests/tests/snapshot/basic/max_chunk_size_remainder/input/page.js"],"sourcesContent":["import { a1 } from './a/a1.js'\nimport { a2 } from './a/a2.js'\nimport { a3 } from './a/a3.js'\nimport { b1 } from './b/b1.js'\nimport { b2 } from './b/b2.js'\nimport { b3 } from './b/b3.js'\n\nexport const page = [a1, a2, a3, b1, b2, b3]\n"],"names":["page"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;;;;;AAEO,MAAMA,OAAO;IAAC,uNAAE;IAAE,uNAAE;IAAE,uNAAE;IAAE,uNAAE;IAAE,uNAAE;IAAE,uNAAE;CAAC"}}]
}
\ No newline at end of file
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