buildLibrary function

Future<BuiltModule> buildLibrary({
  1. required Uri library,
  2. required Directory output,
  3. String? packagesPath,
  4. ExternalLibrary? external,
  5. BuildTarget target = builder.BuildTarget.wasm,
  6. Directory? nativeRuntime,
})

Build a library's selected declarations or rebuild a managed module.

Unsupported declarations raise BindingDiagnostic before output or staging is created. Existing managed modules can be rebuilt on qualified macOS and Linux filesystems; author files are retained. Older, unowned output and npm package directories are not replaced. packagesPath selects the package configuration shared by source analysis and compilation. external selects declarations without changing their library or copying signatures. With external selections, library can also be a package URI. Native builds use target = BuildTarget.native and obtain a pinned precompiled runtime automatically. nativeRuntime supplies an explicit offline bundle instead. Only business Dart AOT is compiled.

Implementation

Future<builder.BuiltModule> buildLibrary({
  required Uri library,
  required Directory output,
  String? packagesPath,
  ExternalLibrary? external,
  builder.BuildTarget target = builder.BuildTarget.wasm,
  Directory? nativeRuntime,
}) => builder.buildLibrary(
  library: library,
  output: output,
  packagesPath: packagesPath,
  external: external,
  target: target,
  nativeRuntime: nativeRuntime,
);