build_modules 1.0.3

  • Installing
  • Versions
  • 63


Module builders for web, used by package:build_web_compilers.
Build Status Issues related to build_modules Pub Package Version Latest Dartdocs Join the chat on Gitter

This package provides generic module builders which can be used to create custom web compilation pipelines. It is used by build_web_compilers package which provides standard builders for DDC and dart2js.


There should be no need to import this package directly unless you are developing a custom builder for web. See documentation in build_web_compilers for more details on building your Dart code with DDC and dart2js.


  • Increased the upper bound for package:analyzer to <0.35.0.


  • Support the latest package:json_annotation.


  • Increased the upper bound for package:analyzer to '<0.34.0'.


Breaking Changes

  • The Module constructor has an additional required parameter isSupported, which indicates if a module is supported on that module's platform.



  • Modules are now platform specific, and config specific imports using dart.library.* constants are supported.

Breaking Configuration Changes

  • Module granularity now has to be configured per platform, so instead of configuring it using the build_modules|modules builder, you now need to configure the builder for each specific platform:
        strategy: fine

The supported platforms are currently dart2js, dartdevc, flutter, and vm.

Breaking API Changes

  • Output extensions of builders have changed to include the platform being built for.
    • All the top level file extension getters are now methods that take a platform and return the extension for that platform.
  • Most builders are no longer applied by default, you must manually apply them using applies_builders in your builder.
  • Most builder constructors now require a platform argument.


  • Module strategies are now respected for all packages instead of just the root package.
  • Can now mix and match fine and coarse strategies at will, even within package cycles (although this may cause larger modules).
  • Removed analyzer dependency.


  • Support package:json_annotation v1.


  • Change the default module strategy for the root package to coarse.



  • Updated dart2js support so that it can do multiple builds concurrently and will restart workers periodically to mitigate the effects of dart-lang/sdk#33708.
  • Increased the upper bound for the sdk to <3.0.0.

Breaking Changes

  • Removed the kernelSummaryExtension, and renamed the KernelSummaryBuilder to KernelBuilder. The new builder can be used to create summaries or full kernel files, and requires users to give it a custom sdk.
  • Changed metaModuleCleanBuilder to read .module.library files which are produced by the moduleLibrayBuilder. Clients using the automatically generated build script will get this automatically. Clients which have manually written build scripts will need to add it.


  • Update to the latest package:scratch_space and don't manually clear it out between builds. This provides significant speed improvements for large projects.


  • Support the latest package:build_config.


  • Updated the missing modules message to highlight that the error is likely due to a missing dependency.


  • Support package:analyzer 0.32.0.


  • Fix a race condition where we could fail to find the modules for some dependencies.


  • Fix an issue where modules were unnecessarily being built with DDC. #1375.


  • Fix an issue with new files causing subsequent build failures #1358.
  • Expose MetaModuleCleanBuilder and metaModuleCleanExtension publicly for usage in tests and manual build scripts.


  • Clean up .module and summary files from the output and server.

  • Add new ModuleBuilder strategies. By default the coarse strategy is used for all non-root packages and will create a minimum number of modules. This strategy can not be overridden. However, for the root package, the fine strategy will be used which creates a module for each strongly connected component. You can override this behavior by providing coarse to the strategy option.

    Example configuration:

              strategy: coarse


  • Give a guaranteed reverse dependency order for Module.computeTransitiveDependencies




  • computeTransitiveDependencies now throws a MissingModulesException instead of logging a warning if it discovers a missing module.


  • Fix a bug with the dart2js workers where the worker could hang if you try to re-use it after calling terminateWorkers. This only really surfaces in test environments.


  • Fix a bug with imports to libraries that have names starting with dart.


  • Split from build_web_compilers.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  build_modules: ^1.0.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:build_modules/build_modules.dart';
Version Uploaded Documentation Archive
1.0.3 Dec 5, 2018 Go to the documentation of build_modules 1.0.3 Download build_modules 1.0.3 archive
1.0.2 Oct 23, 2018 Go to the documentation of build_modules 1.0.2 Download build_modules 1.0.2 archive
1.0.1 Oct 8, 2018 Go to the documentation of build_modules 1.0.1 Download build_modules 1.0.1 archive
1.0.0 Sep 26, 2018 Go to the documentation of build_modules 1.0.0 Download build_modules 1.0.0 archive
0.4.0 Aug 30, 2018 Go to the documentation of build_modules 0.4.0 Download build_modules 0.4.0 archive
0.3.2 Aug 23, 2018 Go to the documentation of build_modules 0.3.2 Download build_modules 0.3.2 archive
0.3.1+1 Jul 24, 2018 Go to the documentation of build_modules 0.3.1+1 Download build_modules 0.3.1+1 archive
0.3.1 Jul 24, 2018 Go to the documentation of build_modules 0.3.1 Download build_modules 0.3.1 archive
0.3.0 Jul 18, 2018 Go to the documentation of build_modules 0.3.0 Download build_modules 0.3.0 archive
0.2.3 Jun 22, 2018 Go to the documentation of build_modules 0.2.3 Download build_modules 0.2.3 archive

All 24 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 6, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: Flutter, other

Primary library: package:build_modules/build_modules.dart with components: io, isolate, build.

Health suggestions

Fix lib/src/errors.dart. (-0.50 points)

Analysis of lib/src/errors.dart reported 1 hint:

line 7 col 1: 'analyzer' is deprecated and shouldn't be used.

Fix lib/src/module_library.dart. (-0.50 points)

Analysis of lib/src/module_library.dart reported 1 hint:

line 7 col 1: 'analyzer' is deprecated and shouldn't be used.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use build_modules.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
analyzer >0.30.0 <0.35.0 0.34.0
async >=1.13.3 <3.0.0 2.0.8
bazel_worker ^0.1.4 0.1.15
build >=0.12.3 <2.0.0 1.0.2
build_config >=0.2.1 <0.4.0 0.3.1+4
glob ^1.0.0 1.1.7
graphs ^0.1.0 0.1.3+1
json_annotation >=1.2.0 <3.0.0 2.0.0
logging ^0.11.2 0.11.3+2
meta ^1.1.0 1.1.6
path ^1.4.2 1.6.2
pedantic ^1.0.0 1.3.0
scratch_space ^0.0.3 0.0.3+2
Transitive dependencies
args 1.5.1
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
csslib 0.14.6
fixnum 0.10.9
front_end 0.1.7
html 0.13.3+3
kernel 0.3.7
package_config 1.0.5
plugin 0.2.0+3
pool 1.3.6
protobuf 0.10.5
pub_semver 1.4.2
pubspec_parse 0.1.2+3
source_span 1.4.1
stack_trace 1.9.3
string_scanner 1.0.4
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_runner ^1.0.0
build_test ^0.10.0
build_vm_compilers ^0.1.0
json_serializable ^1.4.0
source_gen ^0.9.0
test ^1.3.3