This library provides builders for compiling Dart code to Node-compatible
dart2js compilers are supported.
This package is intended to be used as a development dependency for users
node_interop libraries. Simply add the following to your
dev_dependencies: build_runner: # needed to run the build build_node_compilers:
build.yaml file in your project with following contents:
targets: $default: sources: - "node/**" - "test/**" # Include this if you want to compile tests. - "example/**" # Include this if you want to compile examples.
To build your project run following:
pub run build_runner build --output=build/
Note that for projects using node_interop packages the convention is to put main application files (Dart files containing
mainfunction) in the top-level
node/directory. (This is to avoid confusion (and filename collisions) with apps targeting browsers in
web/and package-level binaries in
bin/recognized by Pub).
By default, the
dartdevc compiler is used, which is the Dart Development
If you would like to opt into
dart2js you will need to override
option to build_runner which would look something like this:
pub run build_runner build \ --define="build_node_compilers|entrypoint=compiler=dart2js" \ --output=build/
- Fixed platform names and file extensions conflicting with build_web_compilers.
- Fix: Added node_io to list of known packages that can skip platform checks when compiled with dart2js (#67).
- Internal: fixed all pedantic issues.
- Upgraded to latest build dependencies and synced with build_web_compilers as a reference implementation.
- Added dart_source_cleanup option (#51)
- Upgraded dependencies
- Breaking changes: upgraded to build_runner 1.0.0, build_modules 0.4.0
- Fixed function responsible for resolving module paths for dartdevc to support symlinked entrypoints.
- Upgraded to latest build_runner (fixes dependency resolution with Dart 2 stable).
- Handle entrypoints inside
- Fixed analysis warnings with latest Pub and Dart SDK.
- Fixed strong mode issue with parsing dart2js_args using latest Dart 2 SDK.
- Removed extra dependency constraint on analyzer package.
- Upgraded all dependencies to latest.
- Removed redundant
**_test.dartglob from build config which was causing issues when build_node_compilers used together with build_web_compilers.
- Expand support for package:build_config to include version 0.3.x.
- Fixed deprecation warnings with latest Dart 2 dev SDK.
- Remove extra dependencies in build_node_compilers (#22)
- Upgraded dependencies to match with latest version of build_web_compilers.
.packagesfile and use the new frontend with
dart2jsas a stopgap until we can add support for
- Fixed deprecation warnings.
- Initial version based on
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: build_node_compilers: ^0.2.4
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
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]
We analyzed this package on Mar 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.1
- pana: 0.13.6
Maintenance issues and suggestions
Support latest dependencies. (-10 points)
The version constraint in
pubspec.yaml does not support the latest published versions for 1 dependency (
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
build_node_compilers.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.4.0 <3.0.0|