Build a chunk graph from module dependencies.
Splits modules into chunks based on dynamic import boundaries:
- The entry chunk contains all modules reachable via static imports
- Each dynamic
import()creates a new async chunk - Modules shared between multiple chunks are extracted into common chunks
Chunk types
:entry— the main bundle, loaded synchronously:async— loaded on demand via dynamic import:common— shared code extracted to avoid duplication:manual— user-defined chunk viachunksconfig
Manual chunks
Users can control chunk boundaries via config:
config :volt,
chunks: %{
"vendor" => ["vue", "vue-router", "pinia"],
"ui" => ["assets/src/components"]
}Patterns match module paths: bare specifiers match package names in
node_modules, while path patterns match against the full module path.
Summary
Functions
Build chunks from a module graph.
Types
Functions
Build chunks from a module graph.
modules is a list of {abs_path, label, source} tuples in dependency order.
dep_map maps abs_path => %{static: [abs_path], dynamic: [abs_path]}.
entry_path is the absolute path of the entry file.
Options
:manual_chunks— map of chunk name to list of patterns, e.g.%{"vendor" => ["vue", "vue-router"]}