build_node_compilers

Creator: coderz1093

Last updated:

0 purchases

build_node_compilers Image
build_node_compilers Images

Languages

Categories

Add to Cart

Description:

build node compilers

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:
copied to clipboard
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.
copied to clipboard
To build your project run following:
pub run build_runner build --output=build/
copied to clipboard

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/
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.