4

I'm trying to get dart working. As editor I want to use emacs dart-mode. I've got 2 questions concerning using dart without the dart editor:

1) Do I manually need to call dart2js or does the in html included script dart.js do that for me? Where can I find the dart.js file on a linux system?

2) Where can I find the packages that come with the dart install on a linux system?

Thank you in advance!

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
elfeck
  • 385
  • 1
  • 8

2 Answers2

3

dart.js is contained in the browser package. Once you have added this package to pubspec.yaml and run pub install you can add the script file to your html.

<script src="packages/browser/dart.js"></script>

Assuming you have downloaded the dart bundle you will find all the binaries under $DART_HOME/dart-sdk/bin.

Alexandre Ardhuin
  • 71,959
  • 15
  • 151
  • 132
2

1) You need to call dart2js or pub build for generating JS from Dart

More information about generating Javascript Dart Package Management via dart2js

2) This depends how you installed Dart. I installed by just unpacking the downloaded archiv which contains

install-dir
|- dart-sdk
  |- lib
    |- async
    |- collection
    |- ...
  |- bin
    |- dart
    |- dart2js
    |- dartanalyzer
    |- pub
    |- ...
Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567