Compiling to JavaScript with dart2js

The tool provided to compile Dart down into JavaScript is dart2js. The dart2js compiler can be found among the Dart software development kit builds.[11] The SDK are the ones with “sdk” in the filename (as opposed to the “editor” builds that include the editor in addition to the SDK).

We see that, once unzipped, the SDK contains the entire Dart library (core, html, io, json).

 
+-- bin
 
+-- dart
 
+-- dart2js
 
+-- dartanalyzer
 
+-- dartdoc
 
+-- pub
 
+-- include
 
+-- lib
 
| +-- async
 
| +-- chrome
 
| +-- collection
 
| +-- convert
 
| +-- core
 
| +-- html
 
| +-- indexed_db
 
| +-- io
 
| +-- isolate
 
| +-- js
 
| +-- json
 
| +-- math
 
| +-- mirrors
 
| +-- svg
 
| +-- typed_data
 
| +-- utf
 
| +-- web_audio
 
| +-- ...

Get Dart 1 for Everyone now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.