Questions on using dart without dart editor

437 Views Asked by At

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!

2

There are 2 best solutions below

2
Alexandre Ardhuin On

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.

0
Günter Zöchbauer On

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
    |- ...