build_node_compilers 0.2.0 copy "build_node_compilers: ^0.2.0" to clipboard
build_node_compilers: ^0.2.0 copied to clipboard

outdated

Builders wrapping DDC and dart2js compilers configured to output Node modules.

build_node_compilers #

This library provides builders for compiling Dart code to Node-compatible JavaScript modules. Both dartdevc and dart2js compilers are supported.

Installation #

This package is intended to be used as a development dependency for users of node_interop libraries. Simply add the following to your pubspec.yaml:

dev_dependencies:
  build_runner: # needed to run the build
  build_node_compilers:

Configuration #

Create 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 main function) 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 Compiler.

If you would like to opt into dart2js you will need to override compiler option to build_runner which would look something like this:

pub run build_runner build \
  --define="build_node_compilers|entrypoint=compiler=dart2js" \
  --output=build/
14
likes
0
pub points
35%
popularity

Publisher

unverified uploader

Builders wrapping DDC and dart2js compilers configured to output Node modules.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, bazel_worker, build, build_config, build_modules, cli_util, crypto, node_preamble, path, pool, scratch_space

More

Packages that depend on build_node_compilers