pub struct EntryWeightOutput {
pub path: String,
pub source: String,
pub eager_modules: usize,
pub eager_bytes: u64,
pub eager_css_bytes: u64,
pub deferred_modules: usize,
pub deferred_bytes: u64,
pub out_of_thread_modules: usize,
pub out_of_thread_bytes: u64,
pub eager_package_count: usize,
pub eager_packages: Vec<EagerPackageOutput>,
pub dominating_imports: Vec<DominatingImportOutput>,
}Expand description
Startup import weight of one runtime entry point.
Fields§
§path: StringEntry file, relative to the analysed root.
source: StringWhat declared the entry point, e.g. a plugin or package.json main.
eager_modules: usizeProject modules that load before the entry runs, the entry included.
A static import counts unless it uses the type keyword. An import
of only types without import type still counts, although TypeScript
removes it.
eager_bytes: u64Source bytes of eager_modules.
eager_css_bytes: u64The part of eager_bytes that stylesheets (CSS, Sass, Less)
contribute.
deferred_modules: usizeProject modules that load only on demand through import() or a lazy
glob or template pattern.
deferred_bytes: u64Source bytes of deferred_modules.
out_of_thread_modules: usizeProject modules that only a new URL(..., import.meta.url) reference
(for example a worker URL), a webpack worker loader request (for
example worker-loader!./work.js), child_process.fork, a pino
transport or a module.register hook reaches. They do not load on the thread of
the entry.
out_of_thread_bytes: u64Source bytes of out_of_thread_modules.
eager_package_count: usizeNumber of packages in eager_packages.
eager_packages: Vec<EagerPackageOutput>Packages that eager modules import statically, sorted by name.
Platform built-ins such as node:fs are not listed. Package bytes are
not measured.
dominating_imports: Vec<DominatingImportOutput>Single imports that each keep a part of the eager modules eager, heaviest first. This is evidence for a review, not a fix: a lazy load of code that the first screen needs can make startup slower.