When I select Tools > Generate Javascript in Dart editor, I get an error message saying that I need to select a Dart library. I want to convert the entire project into javascript. I can't figure out how to do that.
Asked
Active
Viewed 1,032 times
2 Answers
2
In the menu,
Tools > Pub build
Then the generated javascript will be created in the /build/web
folder.

Eduardo Copat
- 4,941
- 5
- 23
- 40
1
You need to select a dart file in a project that has a main
function. Then you can use Tools > Generate Javascript to generate the Javascript. Dart automatically find all dependencies and compiles them to Javascript. If you have multiple projects that you want to compile, you need to do it for every project.

Fox32
- 13,126
- 9
- 50
- 71
-
Hi, before asking a new question I thought I use this one as it comes up pretty high on SO search. Compiling the clickme sample of 20 lines of code gets me almost 6000 lines of code in JavaScript. That's a bit more than expected. Can I reduce that by putting it through closure compiler or will that break the code? Noticed when I use `dart2js --minify mini.dart` it's "only" 686 lines. Not sure if I should try and reduce that with closure compiler. Do you have experience with that?' – HMR Nov 16 '13 at 09:20
-
I have only used --minify, no additional closure compiler yet. – Fox32 Nov 16 '13 at 09:24