It's been a long while since I tried
dart2js. In fact it has been so long that it was called
frogcwhen I last saw it. Since I have an open errata for Dart for Hipsters testifying to that fact, this seems like a good time to revisit the command.
When I load my Dart Comics sample app in vanilla Chrome, I am currently seeing the following failure:
dart2jscan fix this.
So I move into the
public/scripts/webdirectory and run
dart2jsnow has command line options (the source of the errata):
Generate the output into . -c Insert runtime type checks and enable assertions (checked mode). -h Display this message (add -v for information about all options).
➜ web git:(master) dart2js -omain.dart.js main.dart Using snapshot /home/chris/local/dart/dart-sdk/bin/../lib/_internal/compiler/implementation/dart2js.dart.snapshotThere is no success message, but
Thankfully, it works flawlessly. I can create a Dart Comics record in Chrome and see it in Dartium:
And best of all, it was very easy and extremely quick.