UPDATE:
A dart development compiler is built into the pub in Dart version 1.24. See here https://github.com/dart-lang/sdk/blob/master/CHANGELOG.md#tool-changes-1
If you want to use it, just use Dart 1.24 and add the following to your pubspec.yaml
web: compiler: debug: dartdevc # Use DDC for pub serve release: dartdevc # Use DDC for pub build
ORIGINAL:
Answering my own question since I got his job. The main problem above is the output directory. If you do not specify an output directory, it does nothing. Therefore, you must provide a name for the output directory. The current directory does not seem to be working. The absolute way seems to work.
Examples that work: dartdevc -o mydir input.dart dartdevc -o /path/to/dir input.dart
An example that does not work: dartdevc -o ./ input.dart
The output for the above example:
var person; (function(exports) { 'use strict'; class Person extends dart.Object { Person(first_name, last_name, amountOfAwesomeness) { if (amountOfAwesomeness === void 0) amountOfAwesomeness = 0; this.first_name = first_name; this.last_name = last_name; this.amountOfAwesomeness = amountOfAwesomeness; } get name() { return `${this.first_name} ${this.last_name} is awesome: ${this.amountOfAwesomeness}`; } }
source share