PackageBuild class final

A reusable npm package declaration for a user-defined Dart build script.

Call build from Dart code, or pass the script's arguments to run for command-line help and per-invocation output and backend selection. Relative paths use the working directory, as in ordinary Dart file operations.

Constructors

PackageBuild({required Uri library, required Directory output, required String name, required String version, Map<String, Object?> metadata = const {}, Map<String, File> assets = const {}, String? packagesPath, ExternalLibrary? external, BuildTarget target = BuildTarget.wasm, Set<BuildTarget>? targets, bool wasmFallback = false, Directory? nativeRuntime})

Properties

assets → Map<String, File>
final
external → ExternalLibrary?
final
hashCode → int
The hash code for this object.
no setterinherited
library → Uri
final
metadata → Map<String, Object?>
Additional npm fields. Supply name and version through their typed fields.
final
name → String
final
nativeRuntime → Directory?
final
output → Directory
final
packagesPath → String?
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
target → BuildTarget
final
targets → Set<BuildTarget>?
final
version → String
final
wasmFallback → bool
Select Wasm for an unsupported native platform on root ESM imports. Requires both targets with a native root. CommonJS remains native-only.
final

Methods

build() → Future<Directory>
Build once with the declared options. Build failures propagate to the caller.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(List<String> arguments) → Future<void>
Run this declaration as the calling script's command-line interface.
toString() → String
A string representation of this object.
inherited

Operators

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