build.dart
is run by Dart Editor whenever a file changes. Many developers use build.dart to compile their Web UI apps. How can I run other commands after Web UI compiler finishes?
Asked
Active
Viewed 149 times
4

Seth Ladd
- 112,095
- 66
- 196
- 279
1 Answers
6
The build()
function returns a Future
. You can register a callback to run after build() runs.
Here is an example:
import 'package:web_ui/component_build.dart';
import 'dart:io';
import 'dart:async';
void main() {
var args = new List.from(new Options().arguments);
args.addAll(['--', '--no-rewrite-urls']);
Future dwc = build(args, ['web/clock_page.html']);
dwc
.then((_) => Process.run('cp', ['packages/browser/dart.js', 'web/out/dart.js']))
.then((_) => Process.run('cp', ['App.css', 'out']));
}
Learn more:

Seth Ladd
- 112,095
- 66
- 196
- 279
-
@Seth How about some more infos about build.dart (a blog post?)? Sounds interesting... – Fox32 Apr 15 '13 at 19:18