How to run commands after building build.dart?

build.dart started by the Dart editor whenever the file changes. Many developers use build.dart to compile their web interface applications. How to run other commands after completing the web interface compiler?

+4
source share
1 answer

The build() function returns a Future . You can register a callback to run after the build () completes.

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'])); } 

More details:

+6
source

All Articles