Reputation: 1198
I am experimenting with Dart's dev_compiler. I think I am missing a couple of steps how to get it working in a browser. Currently all the resources I found regarding it are: Usage
What I'd like to do is:
Problems:
dartdevc -o outputdir lib/mylib.dart
prompts me to specify the --runtime-dir
option. What should that directory be? I use Win dev machine, I specified it to be Pub\Cache\hosted\pub.dartlang.org\dev_compiler-0.1.1+1\lib\runtime
dart
variable. I assume this should be the one defined in dart_runtime.js
. This brings me to the question: what exactly do I have to import in an HTML file to get my transcompiled dart lib work? (scripts srcs)For now I did not get as far as to use the transcompiled library from a browser. Any tips how to do that would be appreciated.
I wrote a little post about my experiences with dev_compiler: dev_compiler experiment
Upvotes: 1
Views: 245
Reputation: 31
This easiest way to play around with this is to use the "server" mode:
dartdevc -o outputdir --server foo.dart
That should generate a foo.html in the output directory that shows you what gets linked in.
For now, this will bring in all the Dart libraries - regardless of what your class actually uses. You may find that you only need a small subset to run your code.
Upvotes: 1