diff --git a/lib/src/barback/asset_environment.dart b/lib/src/barback/asset_environment.dart
index 93b07469cd243d7f5c5d68b103600fe5f70cef22..0a7e595710026cc7c72d3d309b1420608024dca2 100644
--- a/lib/src/barback/asset_environment.dart
+++ b/lib/src/barback/asset_environment.dart
@@ -20,6 +20,7 @@ import '../source/cached.dart';
 import '../utils.dart';
 import 'admin_server.dart';
 import 'barback_server.dart';
+import 'compiler.dart';
 import 'dart_forwarding_transformer.dart';
 import 'dart2js_transformer.dart';
 import 'load_all_transformers.dart';
@@ -41,8 +42,8 @@ class AssetEnvironment {
   /// to [hostname] and have ports based on [basePort]. If omitted, they
   /// default to "localhost" and "0" (use ephemeral ports), respectively.
   ///
-  /// Loads all used transformers using [mode] (including dart2js if
-  /// [useDart2JS] is true).
+  /// Loads all used transformers using [mode] (including dart2js or dartdevc
+  /// based on [compiler]).
   ///
   /// This will only add the root package's "lib" directory to the environment.
   /// Other directories can be added to the environment using [serveDirectory].
@@ -70,21 +71,22 @@ class AssetEnvironment {
       Iterable<String> packages,
       Iterable<AssetId> entrypoints,
       Map<String, String> environmentConstants,
-      bool useDart2JS: true}) {
-    if (watcherType == null) watcherType = WatcherType.NONE;
-    if (hostname == null) hostname = "localhost";
-    if (basePort == null) basePort = 0;
-    if (environmentConstants == null) environmentConstants = {};
+      Compiler compiler}) {
+    watcherType ??= WatcherType.NONE;
+    hostname ??= "localhost";
+    basePort ??= 0;
+    environmentConstants ??= {};
+    compiler ??= Compiler.dart2Js;
 
     return log.progress("Loading asset environment", () async {
       var graph = _adjustPackageGraph(entrypoint.packageGraph, mode, packages);
-      var barback = new Barback(new PubPackageProvider(graph));
+      var barback = new Barback(new PubPackageProvider(graph, compiler));
       barback.log.listen(_log);
 
       var environment = new AssetEnvironment._(graph, barback, mode,
-          watcherType, hostname, basePort, environmentConstants);
+          watcherType, hostname, basePort, environmentConstants, compiler);
 
-      await environment._load(entrypoints: entrypoints, useDart2JS: useDart2JS);
+      await environment._load(entrypoints: entrypoints);
       return environment;
     }, fine: true);
   }
@@ -135,10 +137,6 @@ class AssetEnvironment {
   /// Constants to passed to the built-in dart2js transformer.
   final Map<String, String> environmentConstants;
 
-  /// The [Transformer]s that should be appended by default to the root
-  /// package's transformer cascade. Will be empty if there are none.
-  final _builtInTransformers = <Transformer>[];
-
   /// How source files should be watched.
   final WatcherType _watcherType;
 
@@ -167,21 +165,55 @@ class AssetEnvironment {
   /// go to barback immediately.
   Set<AssetId> _modifiedSources;
 
+  /// The compiler mode for this environment.
+  final Compiler compiler;
+
   AssetEnvironment._(this.graph, this.barback, this.mode, this._watcherType,
-      this._hostname, this._basePort, this.environmentConstants);
+      this._hostname, this._basePort, this.environmentConstants, this.compiler);
 
-  /// Gets the built-in [Transformer]s that should be added to [package].
+  /// Gets the built-in [Transformer]s or [AggregateTransformer]s that should be
+  /// added to [package].
+  ///
+  /// These are returned as an [Iterable<Set>] to represent each phase (the
+  /// outer [Iterable]), and the transformers that should be ran in each phase (
+  /// the inner [Set]).
   ///
   /// Returns `null` if there are none.
-  Iterable<Transformer> getBuiltInTransformers(Package package) {
-    // Built-in transformers only apply to the root package.
-    if (package.name != rootPackage.name) return null;
+  Iterable<Set> getBuiltInTransformers(Package package) {
+    var transformers = <Set>[];
 
-    // The built-in transformers are for dart2js and forwarding assets around
-    // dart2js.
-    if (_builtInTransformers.isEmpty) return null;
+    if (compiler == Compiler.dartDevc) {
+      // TODO(jakemac53): Implement dartdevc!
+      throw new UnimplementedError(
+          'The dartdevc compiler is not yet supported.');
+    }
 
-    return _builtInTransformers;
+    // These transformers are just for the root package.
+    if (package.name == rootPackage.name) {
+      switch (compiler) {
+        case Compiler.dart2Js:
+          // If the entrypoint package manually configures the dart2js
+          // transformer, don't include it in the built-in transformer list.
+          //
+          // TODO(nweiz): if/when we support more built-in transformers, make
+          // this more general.
+          var containsDart2JS = graph.entrypoint.root.pubspec.transformers.any(
+              (transformers) => transformers
+                  .any((config) => config.id.package == '\$dart2js'));
+
+          if (!containsDart2JS && compiler == Compiler.dart2Js) {
+            transformers.add([
+              new Dart2JSTransformer(this, mode),
+              new DartForwardingTransformer(),
+            ].toSet());
+          }
+          break;
+        default:
+          break;
+      }
+    }
+
+    return transformers;
   }
 
   /// Starts up the admin server on an appropriate port and returns it.
@@ -431,32 +463,19 @@ class AssetEnvironment {
   /// in packages in [graph] and re-runs them as necessary when any input files
   /// change.
   ///
-  /// If [useDart2JS] is `true`, then the [Dart2JSTransformer] is implicitly
+  /// If [Compiler.dart2Js], then the [Dart2JSTransformer] is implicitly
   /// added to end of the root package's transformer phases.
   ///
+  /// if [Compiler.dartDevc], then the [DevCompilerTransformer] is
+  /// implicitly added to the end of all package's transformer phases.
+  ///
   /// If [entrypoints] is passed, only transformers necessary to run those
   /// entrypoints will be loaded.
   ///
   /// Returns a [Future] that completes once all inputs and transformers are
   /// loaded.
-  Future _load({Iterable<AssetId> entrypoints, bool useDart2JS}) {
+  Future _load({Iterable<AssetId> entrypoints}) {
     return log.progress("Initializing barback", () async {
-      // If the entrypoint package manually configures the dart2js
-      // transformer, don't include it in the built-in transformer list.
-      //
-      // TODO(nweiz): if/when we support more built-in transformers, make
-      // this more general.
-      var containsDart2JS = graph.entrypoint.root.pubspec.transformers.any(
-          (transformers) =>
-              transformers.any((config) => config.id.package == '\$dart2js'));
-
-      if (!containsDart2JS && useDart2JS) {
-        _builtInTransformers.addAll([
-          new Dart2JSTransformer(this, mode),
-          new DartForwardingTransformer()
-        ]);
-      }
-
       // Bind a server that we can use to load the transformers.
       var transformerServer = await BarbackServer.bind(this, _hostname, 0);
 
@@ -509,7 +528,9 @@ class AssetEnvironment {
     // other build directories in the root package by calling
     // [serveDirectory].
     await Future.wait(graph.packages.values.map((package) async {
-      if (graph.isPackageStatic(package.name)) return;
+      if (graph.isPackageStatic(package.name, compiler)) {
+        return;
+      }
       await _provideDirectorySources(package, "lib");
     }));
   }
diff --git a/lib/src/barback/compiler.dart b/lib/src/barback/compiler.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c376075e1b41f3c6aadf2850a1016be861069801
--- /dev/null
+++ b/lib/src/barback/compiler.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+const _dart2JsName = 'dart2js';
+const _dartDevcName = 'dartdevc';
+const _noneName = 'none';
+
+/// The compiler currently being used (or none).
+///
+/// This is controlled by the `--compiler=$name` flag.
+class Compiler {
+  static const dart2Js = const Compiler._(_dart2JsName);
+  static const dartDevc = const Compiler._(_dartDevcName);
+  static const none = const Compiler._(_noneName);
+
+  static final all = [dart2Js, dartDevc, none];
+  static Iterable<String> get names => all.map((compiler) => compiler.name);
+
+  final String name;
+
+  const Compiler._(this.name);
+
+  static Compiler byName(String name) =>
+      all.firstWhere((compiler) => compiler.name == name, orElse: () {
+        throw new ArgumentError(
+            'Unrecognized compiler `$name`, supported compilers are '
+            '`${names.join(", ")}`.');
+      });
+
+  String toString() => name;
+}
diff --git a/lib/src/barback/load_all_transformers.dart b/lib/src/barback/load_all_transformers.dart
index 1885682797c5ea23343be33ae024df7f074a6ea4..d4cbda291eba8511afc2ad772f9171d1a133ffb4 100644
--- a/lib/src/barback/load_all_transformers.dart
+++ b/lib/src/barback/load_all_transformers.dart
@@ -103,8 +103,7 @@ Future loadAllTransformers(
   await Future.wait(environment.graph.packages.values.map((package) async {
     var phases =
         await loader.transformersForPhases(package.pubspec.transformers);
-    var transformers = environment.getBuiltInTransformers(package);
-    if (transformers != null) phases.add(transformers);
+    phases.addAll(environment.getBuiltInTransformers(package));
     if (phases.isEmpty) return;
 
     // TODO(nweiz): remove the [newFuture] here when issue 17305 is fixed.
diff --git a/lib/src/barback/pub_package_provider.dart b/lib/src/barback/pub_package_provider.dart
index 0e50ceeadf0822d1e2b937f71dee59767d683b49..d614a5bbfea0826e1d13fc3c4c87f3f7b874c5df 100644
--- a/lib/src/barback/pub_package_provider.dart
+++ b/lib/src/barback/pub_package_provider.dart
@@ -12,6 +12,7 @@ import 'package:path/path.dart' as p;
 import 'package:package_resolver/package_resolver.dart';
 import 'package:pub_semver/pub_semver.dart';
 
+import 'compiler.dart';
 import '../io.dart';
 import '../package.dart';
 import '../package_graph.dart';
@@ -43,10 +44,10 @@ class PubPackageProvider implements StaticPackageProvider {
   Iterable<String> get packages =>
       _graph.packages.keys.toSet().difference(staticPackages.toSet());
 
-  PubPackageProvider(PackageGraph graph)
+  PubPackageProvider(PackageGraph graph, Compiler compiler)
       : _graph = graph,
-        staticPackages = [r"$pub", r"$sdk"]
-          ..addAll(graph.packages.keys.where(graph.isPackageStatic));
+        staticPackages = [r"$pub", r"$sdk"]..addAll(graph.packages.keys
+            .where((p) => graph.isPackageStatic(p, compiler)));
 
   Future<Asset> getAsset(AssetId id) async {
     // "$pub" is a psuedo-package that allows pub's transformer-loading
diff --git a/lib/src/barback/transformer_loader.dart b/lib/src/barback/transformer_loader.dart
index 28c87b6e874912d10a6f97376b4affea6a2d6846..d1d1ef5a87cce30aad091593fc6b1a9d5322fae1 100644
--- a/lib/src/barback/transformer_loader.dart
+++ b/lib/src/barback/transformer_loader.dart
@@ -10,6 +10,7 @@ import '../log.dart' as log;
 import '../utils.dart';
 import 'asset_environment.dart';
 import 'barback_server.dart';
+import 'compiler.dart';
 import 'dart2js_transformer.dart';
 import 'excluding_transformer.dart';
 import 'transformer_config.dart';
@@ -99,22 +100,28 @@ class TransformerLoader {
 
     var transformer;
     try {
-      transformer = new Dart2JSTransformer.withSettings(_environment,
-          new BarbackSettings(config.configuration, _environment.mode));
+      if (_environment.compiler == Compiler.dart2Js) {
+        transformer = new Dart2JSTransformer.withSettings(_environment,
+            new BarbackSettings(config.configuration, _environment.mode));
+        // Handle any exclusions.
+        _transformers[config] =
+            new Set.from([ExcludingTransformer.wrap(transformer, config)]);
+      } else {
+        // Empty set if dart2js is disabled based on compiler flag.
+        _transformers[config] = new Set();
+      }
     } on FormatException catch (error, stackTrace) {
       fail(error.message, error, stackTrace);
     }
 
-    // Handle any exclusions.
-    _transformers[config] =
-        new Set.from([ExcludingTransformer.wrap(transformer, config)]);
     return _transformers[config];
   }
 
-  /// Loads all transformers defined in each phase of [phases].
+  /// Loads all [Transformer]s or [AggregateTransformer]s defined in each phase
+  /// of [phases].
   ///
   /// If any library hasn't yet been loaded via [load], it will be ignored.
-  Future<List<Set<Transformer>>> transformersForPhases(
+  Future<List<Set>> transformersForPhases(
       Iterable<Set<TransformerConfig>> phases) async {
     var result = await Future.wait(phases.map((phase) async {
       var transformers = await waitAndPrintErrors(phase.map(transformersFor));
diff --git a/lib/src/command/barback.dart b/lib/src/command/barback.dart
index e5bde55839d48c12a782ed6e7b77146f243e9873..08313adbd01b67cd3ac45940721389c34901abaa 100644
--- a/lib/src/command/barback.dart
+++ b/lib/src/command/barback.dart
@@ -7,6 +7,7 @@ import 'dart:async';
 import 'package:barback/barback.dart';
 import 'package:path/path.dart' as path;
 
+import '../barback/compiler.dart';
 import '../command.dart';
 import '../io.dart';
 import '../log.dart' as log;
@@ -24,6 +25,28 @@ abstract class BarbackCommand extends PubCommand {
   /// The build mode.
   BarbackMode get mode => new BarbackMode(argResults["mode"]);
 
+  /// The current compiler mode.
+  Compiler get compiler {
+    if (argResults.options.contains('dart2js') &&
+        argResults.wasParsed('dart2js')) {
+      if (argResults.options.contains("compiler") &&
+          argResults.wasParsed("compiler")) {
+        usageException(
+            "The --dart2js flag can't be used with the --compiler arg. "
+            "Prefer using the --compiler arg as --[no]-dart2js is deprecated.");
+      }
+      if (argResults['dart2js']) {
+        return Compiler.dart2Js;
+      } else {
+        return Compiler.none;
+      }
+    } else if (argResults.options.contains("compiler")) {
+      return Compiler.byName(argResults["compiler"]);
+    } else {
+      return Compiler.dart2Js;
+    }
+  }
+
   /// The directories in the entrypoint package that should be added to the
   /// build environment.
   final sourceDirectories = new Set<String>();
@@ -44,6 +67,11 @@ abstract class BarbackCommand extends PubCommand {
         help: "Use all default source directories.",
         defaultsTo: false,
         negatable: false);
+
+    argParser.addOption("compiler",
+        allowed: Compiler.names,
+        defaultsTo: 'dart2js',
+        help: 'The JavaScript compiler to use to build the app.');
   }
 
   Future run() {
diff --git a/lib/src/command/build.dart b/lib/src/command/build.dart
index f8ce3821aed22a22f2c585a90a7f125b81233728..5805b152325ca06cba45f9150aab3d34c3001979 100644
--- a/lib/src/command/build.dart
+++ b/lib/src/command/build.dart
@@ -67,7 +67,7 @@ class BuildCommand extends BarbackCommand {
       // user-facing, just use an IPv4 address to avoid a weird bug on the OS X
       // buildbots.
       var environment = await AssetEnvironment.create(entrypoint, mode,
-          environmentConstants: environmentConstants, useDart2JS: true);
+          environmentConstants: environmentConstants, compiler: compiler);
 
       var hasError = false;
       // Show in-progress errors, but not results. Those get handled
diff --git a/lib/src/command/serve.dart b/lib/src/command/serve.dart
index 60b788f1e0de654bbb164f0cb9ab60c9174fd901..2a785315c9ab464d70778dbedc2fa6a5452affed 100644
--- a/lib/src/command/serve.dart
+++ b/lib/src/command/serve.dart
@@ -38,9 +38,6 @@ class ServeCommand extends BarbackCommand {
     return adminPort == null ? null : parseInt(adminPort, 'admin port');
   }
 
-  /// `true` if Dart entrypoints should be compiled to JavaScript.
-  bool get useDart2JS => argResults['dart2js'];
-
   /// `true` if the admin server URL should be displayed on startup.
   bool get logAdminUrl => argResults['log-admin-url'];
 
@@ -74,7 +71,9 @@ class ServeCommand extends BarbackCommand {
     argParser.addOption('admin-port', hide: true);
 
     argParser.addFlag('dart2js',
-        defaultsTo: true, help: 'Compile Dart to JavaScript.');
+        defaultsTo: true,
+        help: 'Deprecated: Use --compiler=none to disable js compilation.',
+        hide: true);
     argParser.addFlag('force-poll',
         defaultsTo: false,
         help: 'Force the use of a polling filesystem watcher.');
@@ -98,7 +97,7 @@ class ServeCommand extends BarbackCommand {
         watcherType: watcherType,
         hostname: hostname,
         basePort: port,
-        useDart2JS: useDart2JS,
+        compiler: compiler,
         environmentConstants: environmentConstants);
     var directoryLength =
         sourceDirectories.map((dir) => dir.length).reduce(math.max);
diff --git a/lib/src/entrypoint.dart b/lib/src/entrypoint.dart
index b8cfc3112de8b2607f6ddd0ab29751bcb8ee3685..d2a154cffca7225d086f782e61cda9dccb580eb5 100644
--- a/lib/src/entrypoint.dart
+++ b/lib/src/entrypoint.dart
@@ -11,6 +11,7 @@ import 'package:path/path.dart' as p;
 import 'package:pub_semver/pub_semver.dart';
 
 import 'barback/asset_environment.dart';
+import 'barback/compiler.dart';
 import 'dart.dart' as dart;
 import 'exceptions.dart';
 import 'flutter.dart' as flutter;
@@ -258,7 +259,7 @@ class Entrypoint {
             .toSet();
 
         var environment = await AssetEnvironment.create(this, BarbackMode.DEBUG,
-            packages: packagesToLoad, useDart2JS: false);
+            packages: packagesToLoad, compiler: Compiler.none);
 
         /// Ignore barback errors since they'll be emitted via [getAllAssets]
         /// below.
@@ -408,7 +409,7 @@ class Entrypoint {
     var environment = await AssetEnvironment.create(this, BarbackMode.RELEASE,
         packages: packagesToLoad.map((package) => package.name),
         entrypoints: executableIds,
-        useDart2JS: false);
+        compiler: Compiler.none);
     environment.barback.errors.listen((error) {
       log.error(log.red("Build error:\n$error"));
     });
diff --git a/lib/src/executable.dart b/lib/src/executable.dart
index bb8cbb47854982c21db3cac506e44683e79dfdb7..4c52b7788cc430daf360f7724ff4f333d5a156ed 100644
--- a/lib/src/executable.dart
+++ b/lib/src/executable.dart
@@ -10,6 +10,7 @@ import 'package:barback/barback.dart';
 import 'package:path/path.dart' as p;
 
 import 'barback/asset_environment.dart';
+import 'barback/compiler.dart';
 import 'entrypoint.dart';
 import 'exit_codes.dart' as exit_codes;
 import 'io.dart';
@@ -136,7 +137,7 @@ Future<Uri> _executableUrl(Entrypoint entrypoint, String package, String path,
   // TODO(nweiz): Use [packages] to only load assets from packages that the
   // executable might load.
   var environment = await AssetEnvironment
-      .create(entrypoint, mode, useDart2JS: false, entrypoints: [id]);
+      .create(entrypoint, mode, compiler: Compiler.none, entrypoints: [id]);
   environment.barback.errors.listen((error) {
     log.error(log.red("Build error:\n$error"));
   });
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index 23bfd61e18130897c6fb1da9df6176696f7df2cf..e44e0ebfbcbb1c22154cf4aec17481dafeb7d8da 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -10,6 +10,7 @@ import 'package:barback/barback.dart';
 import 'package:pub_semver/pub_semver.dart';
 
 import 'barback/asset_environment.dart';
+import 'barback/compiler.dart';
 import 'dart.dart' as dart;
 import 'entrypoint.dart';
 import 'exceptions.dart';
@@ -248,7 +249,7 @@ class GlobalPackages {
       Entrypoint entrypoint, Package package, String dir) async {
     var environment = await AssetEnvironment.create(
         entrypoint, BarbackMode.RELEASE,
-        entrypoints: package.executableIds, useDart2JS: false);
+        entrypoints: package.executableIds, compiler: Compiler.none);
     environment.barback.errors.listen((error) {
       log.error(log.red("Build error:\n$error"));
     });
diff --git a/lib/src/package_graph.dart b/lib/src/package_graph.dart
index f0bd549a18960fd1638904c73e8b8ee50ae96fe2..12f30bceada66a1dd5912105e36e416b919765f6 100644
--- a/lib/src/package_graph.dart
+++ b/lib/src/package_graph.dart
@@ -4,6 +4,7 @@
 
 import 'package:collection/collection.dart';
 
+import 'barback/compiler.dart';
 import 'barback/transformer_cache.dart';
 import 'entrypoint.dart';
 import 'lock_file.dart';
@@ -44,12 +45,13 @@ class PackageGraph {
   factory PackageGraph.fromSolveResult(
       Entrypoint entrypoint, SolveResult result) {
     var packages = new Map<String, Package>.fromIterable(result.packages,
-        key: (id) => id.name, value: (id) {
-      if (id.name == entrypoint.root.name) return entrypoint.root;
+        key: (id) => id.name,
+        value: (id) {
+          if (id.name == entrypoint.root.name) return entrypoint.root;
 
-      return new Package(result.pubspecs[id.name],
-          entrypoint.cache.source(id.source).getDirectory(id));
-    });
+          return new Package(result.pubspecs[id.name],
+              entrypoint.cache.source(id.source).getDirectory(id));
+        });
 
     return new PackageGraph(entrypoint, result.lockFile, packages);
   }
@@ -151,9 +153,13 @@ class PackageGraph {
   /// from a cached source. Static packages don't need to be fully processed by
   /// barback.
   ///
+  /// If [compiler] is [Compiler.dartDevc] then no package is static because the
+  /// transformer will be added to all packages.
+  ///
   /// Note that a static package isn't the same as an immutable package (see
   /// [isPackageMutable]).
-  bool isPackageStatic(String package) {
+  bool isPackageStatic(String package, Compiler compiler) {
+    if (compiler == Compiler.dartDevc) return false;
     var id = lockFile.packages[package];
     if (id == null) return false;
     if (entrypoint.cache.source(id.source) is! CachedSource) return false;
diff --git a/test/dart2js/allows_import_in_dart_code_test.dart b/test/compiler/allows_import_in_dart_code_test.dart
similarity index 100%
rename from test/dart2js/allows_import_in_dart_code_test.dart
rename to test/compiler/allows_import_in_dart_code_test.dart
diff --git a/test/compiler/compiler_flag_test.dart b/test/compiler/compiler_flag_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..91cb0a2a05df8b7c97c415cebf1f7510b3f00175
--- /dev/null
+++ b/test/compiler/compiler_flag_test.dart
@@ -0,0 +1,62 @@
+// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS d.file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:scheduled_test/scheduled_stream.dart';
+
+import 'package:pub/src/exit_codes.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import '../serve/utils.dart';
+
+main() {
+  integration("compiler flag switches compilers", () {
+    d.dir(appPath, [
+      d.appPubspec(),
+      d.dir("lib", [
+        d.file("hello.dart", "hello() => print('hello');"),
+      ])
+    ]).create();
+
+    pubGet();
+    var process = startPubServe(args: ['--compiler', 'dartdevc']);
+    // TODO(jakemac53): Update when dartdevc is supported.
+    process.shouldExit(1);
+    process.stderr
+        .expect(consumeThrough('The dartdevc compiler is not yet supported.'));
+  });
+
+  integration("invalid compiler flag gives an error", () {
+    d.dir(appPath, [
+      d.appPubspec(),
+    ]).create();
+
+    pubGet();
+    var process = startPubServe(args: ['--compiler', 'invalid']);
+    process.shouldExit(USAGE);
+    process.stderr.expect(consumeThrough(
+        '"invalid" is not an allowed value for option "compiler".'));
+  });
+
+  integration("--dart2js with --compiler is invalid", () {
+    d.dir(appPath, [
+      d.appPubspec(),
+    ]).create();
+
+    pubGet();
+    var argCombos = [
+      ['--dart2js', '--compiler=dartdevc'],
+      ['--no-dart2js', '--compiler=dartdevc'],
+      ['--dart2js', '--compiler=dart2js'],
+      ['--no-dart2js', '--compiler=dart2js'],
+    ];
+    for (var args in argCombos) {
+      var process = startPubServe(args: args);
+      process.shouldExit(USAGE);
+      process.stderr.expect(consumeThrough(
+          "The --dart2js flag can't be used with the --compiler arg. Prefer "
+          "using the --compiler arg as --[no]-dart2js is deprecated."));
+    }
+  });
+}
diff --git a/test/dart2js/compiles_entrypoints_in_root_package_test.dart b/test/compiler/compiles_entrypoints_in_root_package_test.dart
similarity index 100%
rename from test/dart2js/compiles_entrypoints_in_root_package_test.dart
rename to test/compiler/compiles_entrypoints_in_root_package_test.dart
diff --git a/test/dart2js/compiles_generated_dart_file_test.dart b/test/compiler/compiles_generated_dart_file_test.dart
similarity index 100%
rename from test/dart2js/compiles_generated_dart_file_test.dart
rename to test/compiler/compiles_generated_dart_file_test.dart
diff --git a/test/dart2js/compiles_generated_file_from_dependency_outside_web_test.dart b/test/compiler/compiles_generated_file_from_dependency_outside_web_test.dart
similarity index 100%
rename from test/dart2js/compiles_generated_file_from_dependency_outside_web_test.dart
rename to test/compiler/compiles_generated_file_from_dependency_outside_web_test.dart
diff --git a/test/dart2js/compiles_generated_file_from_dependency_test.dart b/test/compiler/compiles_generated_file_from_dependency_test.dart
similarity index 100%
rename from test/dart2js/compiles_generated_file_from_dependency_test.dart
rename to test/compiler/compiles_generated_file_from_dependency_test.dart
diff --git a/test/dart2js/compiles_imported_generated_file_test.dart b/test/compiler/compiles_imported_generated_file_test.dart
similarity index 100%
rename from test/dart2js/compiles_imported_generated_file_test.dart
rename to test/compiler/compiles_imported_generated_file_test.dart
diff --git a/test/dart2js/converts_isolate_entrypoint_in_web_test.dart b/test/compiler/converts_isolate_entrypoint_in_web_test.dart
similarity index 100%
rename from test/dart2js/converts_isolate_entrypoint_in_web_test.dart
rename to test/compiler/converts_isolate_entrypoint_in_web_test.dart
diff --git a/test/dart2js/does_not_compile_if_disabled_test.dart b/test/compiler/does_not_compile_if_disabled_test.dart
similarity index 100%
rename from test/dart2js/does_not_compile_if_disabled_test.dart
rename to test/compiler/does_not_compile_if_disabled_test.dart
diff --git a/test/dart2js/does_not_compile_until_its_output_is_requested_test.dart b/test/compiler/does_not_compile_until_its_output_is_requested_test.dart
similarity index 100%
rename from test/dart2js/does_not_compile_until_its_output_is_requested_test.dart
rename to test/compiler/does_not_compile_until_its_output_is_requested_test.dart
diff --git a/test/dart2js/does_not_support_invalid_command_line_options_type_test.dart b/test/compiler/does_not_support_invalid_command_line_options_type_test.dart
similarity index 100%
rename from test/dart2js/does_not_support_invalid_command_line_options_type_test.dart
rename to test/compiler/does_not_support_invalid_command_line_options_type_test.dart
diff --git a/test/dart2js/does_not_support_invalid_environment_type_test.dart b/test/compiler/does_not_support_invalid_environment_type_test.dart
similarity index 100%
rename from test/dart2js/does_not_support_invalid_environment_type_test.dart
rename to test/compiler/does_not_support_invalid_environment_type_test.dart
diff --git a/test/dart2js/does_not_support_invalid_option_test.dart b/test/compiler/does_not_support_invalid_option_test.dart
similarity index 100%
rename from test/dart2js/does_not_support_invalid_option_test.dart
rename to test/compiler/does_not_support_invalid_option_test.dart
diff --git a/test/dart2js/doesnt_support_invalid_type_for_boolean_option_test.dart b/test/compiler/doesnt_support_invalid_type_for_boolean_option_test.dart
similarity index 100%
rename from test/dart2js/doesnt_support_invalid_type_for_boolean_option_test.dart
rename to test/compiler/doesnt_support_invalid_type_for_boolean_option_test.dart
diff --git a/test/dart2js/environment_constant_test.dart b/test/compiler/environment_constant_test.dart
similarity index 100%
rename from test/dart2js/environment_constant_test.dart
rename to test/compiler/environment_constant_test.dart
diff --git a/test/dart2js/ignores_entrypoint_in_dependency_test.dart b/test/compiler/ignores_entrypoint_in_dependency_test.dart
similarity index 100%
rename from test/dart2js/ignores_entrypoint_in_dependency_test.dart
rename to test/compiler/ignores_entrypoint_in_dependency_test.dart
diff --git a/test/dart2js/ignores_entrypoints_in_lib_test.dart b/test/compiler/ignores_entrypoints_in_lib_test.dart
similarity index 100%
rename from test/dart2js/ignores_entrypoints_in_lib_test.dart
rename to test/compiler/ignores_entrypoints_in_lib_test.dart
diff --git a/test/dart2js/ignores_non_entrypoint_dart_files_test.dart b/test/compiler/ignores_non_entrypoint_dart_files_test.dart
similarity index 100%
rename from test/dart2js/ignores_non_entrypoint_dart_files_test.dart
rename to test/compiler/ignores_non_entrypoint_dart_files_test.dart
diff --git a/test/dart2js/includes_source_maps_if_sourceMaps_true_test.dart b/test/compiler/includes_source_maps_if_sourceMaps_true_test.dart
similarity index 100%
rename from test/dart2js/includes_source_maps_if_sourceMaps_true_test.dart
rename to test/compiler/includes_source_maps_if_sourceMaps_true_test.dart
diff --git a/test/dart2js/includes_source_maps_in_debug_test.dart b/test/compiler/includes_source_maps_in_debug_test.dart
similarity index 100%
rename from test/dart2js/includes_source_maps_in_debug_test.dart
rename to test/compiler/includes_source_maps_in_debug_test.dart
diff --git a/test/dart2js/minifies_in_release_mode_test.dart b/test/compiler/minifies_in_release_mode_test.dart
similarity index 100%
rename from test/dart2js/minifies_in_release_mode_test.dart
rename to test/compiler/minifies_in_release_mode_test.dart
diff --git a/test/dart2js/minify_configuration_overrides_mode_test.dart b/test/compiler/minify_configuration_overrides_mode_test.dart
similarity index 100%
rename from test/dart2js/minify_configuration_overrides_mode_test.dart
rename to test/compiler/minify_configuration_overrides_mode_test.dart
diff --git a/test/dart2js/omits_source_map_if_sourceMaps_false_test.dart b/test/compiler/omits_source_map_if_sourceMaps_false_test.dart
similarity index 100%
rename from test/dart2js/omits_source_map_if_sourceMaps_false_test.dart
rename to test/compiler/omits_source_map_if_sourceMaps_false_test.dart
diff --git a/test/dart2js/omits_source_map_in_release_test.dart b/test/compiler/omits_source_map_in_release_test.dart
similarity index 100%
rename from test/dart2js/omits_source_map_in_release_test.dart
rename to test/compiler/omits_source_map_in_release_test.dart
diff --git a/test/dart2js/output_can_be_consumed_by_successive_phases.dart b/test/compiler/output_can_be_consumed_by_successive_phases.dart
similarity index 100%
rename from test/dart2js/output_can_be_consumed_by_successive_phases.dart
rename to test/compiler/output_can_be_consumed_by_successive_phases.dart
diff --git a/test/dart2js/outputs_deferred_libraries_test.dart b/test/compiler/outputs_deferred_libraries_test.dart
similarity index 100%
rename from test/dart2js/outputs_deferred_libraries_test.dart
rename to test/compiler/outputs_deferred_libraries_test.dart
diff --git a/test/dart2js/passes_along_environment_constants_test.dart b/test/compiler/passes_along_environment_constants_test.dart
similarity index 100%
rename from test/dart2js/passes_along_environment_constants_test.dart
rename to test/compiler/passes_along_environment_constants_test.dart
diff --git a/test/dart2js/reports_dart_parse_errors_test.dart b/test/compiler/reports_dart_parse_errors_test.dart
similarity index 100%
rename from test/dart2js/reports_dart_parse_errors_test.dart
rename to test/compiler/reports_dart_parse_errors_test.dart
diff --git a/test/dart2js/source_maps_are_self_contained_test.dart b/test/compiler/source_maps_are_self_contained_test.dart
similarity index 100%
rename from test/dart2js/source_maps_are_self_contained_test.dart
rename to test/compiler/source_maps_are_self_contained_test.dart
diff --git a/test/dart2js/source_maps_include_core_libs_in_subdirectory_test.dart b/test/compiler/source_maps_include_core_libs_in_subdirectory_test.dart
similarity index 100%
rename from test/dart2js/source_maps_include_core_libs_in_subdirectory_test.dart
rename to test/compiler/source_maps_include_core_libs_in_subdirectory_test.dart
diff --git a/test/dart2js/source_maps_include_core_libs_test.dart b/test/compiler/source_maps_include_core_libs_test.dart
similarity index 100%
rename from test/dart2js/source_maps_include_core_libs_test.dart
rename to test/compiler/source_maps_include_core_libs_test.dart
diff --git a/test/dart2js/supports_configuration_with_build_test.dart b/test/compiler/supports_configuration_with_build_test.dart
similarity index 100%
rename from test/dart2js/supports_configuration_with_build_test.dart
rename to test/compiler/supports_configuration_with_build_test.dart
diff --git a/test/dart2js/supports_valid_options_test.dart b/test/compiler/supports_valid_options_test.dart
similarity index 100%
rename from test/dart2js/supports_valid_options_test.dart
rename to test/compiler/supports_valid_options_test.dart
diff --git a/test/dart2js/unminified_in_nonrelease_mode_test.dart b/test/compiler/unminified_in_nonrelease_mode_test.dart
similarity index 100%
rename from test/dart2js/unminified_in_nonrelease_mode_test.dart
rename to test/compiler/unminified_in_nonrelease_mode_test.dart