The Avenx bundler: resolve, link, shake, emit.
The boundary this file sits on
The compiler owns everything Avenx-specific — template compilation, declaration processing, expression handling, Atlas, scoped CSS, the shape of a generated component class. It hands the bundler modules: some virtual (the classes it just generated), the rest real files on disk.
The bundler owns everything module-specific — resolution, npm packages, the
dependency graph, dead-code elimination, format interop, the final script and
its source map. It knows nothing about components, bridges or pages, and it
must stay that way: the moment the bundler needs to know what a .page.js is,
the two halves have grown back together.
Why Avenx has its own
The same reason it has its own HTML tokenizer, its own expression parser and its own reference scanner: the build is dependency-free by policy. A bundler is a graph walk, a reachability analysis and a code generator, and each of those is a few hundred lines when it only has to serve one compiler.
- Source:
Methods
(static) bundle(options) → {Object}
Bundles an application from one or more entry modules.
Parameters:
- Source:
Throws:
-
When the application does not link.
- Type
- ResolveError | BindingError | EmitError | ModuleParseError
Returns:
The bundle and what it contains.
- Type
- Object