Bundler class

The Bundler class is responsible for managing and bundling JavaScript assets.

It combines multiple JS files (from third-party packages and optionally a custom main JS file) into a single bundle.js output file. This is useful for reducing HTTP requests and organizing frontend assets for production.

The bundler will:

  • Read JS files listed in the files section of the dependencies block
  • Optionally include a main JS file
  • Output a single bundled bundle.js into the destination directory
  • Log errors for any missing files
Inheritance

Constructors

Bundler(Destination destination, {required String dependencyMainFile, required bool debug})

Properties

buffer StringBuffer
getter/setter pairinherited
bundleFile File
getter/setter pairinherited
bundlePath String
getter/setter pairinherited
debug bool
getter/setter pairinherited
dependencyMainFile String
getter/setter pairinherited
destination Destination
finalinherited
hashCode int
The hash code for this object.
no setterinherited
nodeModules Directory
getter/setter pair
outputDir Directory
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bundleFiles(List<String> files, String dependencySrc, StringBuffer buff) → void
Merges and writes JavaScript files into a single bundle.js file.
override
destroyBundleFile() → void
inherited
end(Stopwatch stopwatch) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() → void
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited