jsRequires top-level property

ConfigVariable<List<JSRequire>> jsRequires
final

A modifiable list of JavaScript packages to require() at the beginning of the generated JS file.

The same identifier may be used for multiple requires. If so, the require with the most specific JSRequireTarget will be used for a given identifier on a given platform. If there are multiple requires with the same JSRequireTarget, the last one will be used.

If an executable passes a literal string to require() through Dart's JS interop and a JSRequire is specified for that package, the interop require() will be converted to a reference to the JSRequire. If there is no JSRequire, one will be added automatically.

If any requires have a target other than JSRequireTarget.cli or JSRequireTarget.all, jsModuleMainLibrary must also be set, since otherwise there's no reason to split requires up by target.

Implementation

final jsRequires = InternalConfigVariable.value<List<JSRequire>>([],
    freeze: (list) => List.unmodifiable(list));