Chromium Code Reviews

Unified Diff: sdk/lib/_internal/pub/lib/src/dart.dart

Issue 47793003: Control whether pub build and serve minify or not. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: sdk/lib/_internal/pub/lib/src/dart.dart
diff --git a/sdk/lib/_internal/pub/lib/src/dart.dart b/sdk/lib/_internal/pub/lib/src/dart.dart
index d183f37e40cbbb65c7ad70aaee6c19ad210af186..6e06f044c128ac172150c1f8f28ae1c83c398302 100644
--- a/sdk/lib/_internal/pub/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub/lib/src/dart.dart
@@ -30,12 +30,17 @@ import 'utils.dart';
/// If [inputProvider] and [diagnosticHandler] are omitted, uses a default
/// [compiler.CompilerInputProvider] that loads directly from the filesystem.
/// If either is provided, both must be.
-Future<String> compile(String entrypoint, {String packageRoot,
- bool toDart: false, compiler.CompilerInputProvider inputProvider,
+Future<String> compile(String entrypoint, {
+ String packageRoot,
+ bool toDart: false,
+ bool minify: true,
+ compiler.CompilerInputProvider inputProvider,
compiler.DiagnosticHandler diagnosticHandler}) {
nweiz 2013/10/29 23:18:53 What are the criteria for whether a set or paramet
Bob Nystrom 2013/10/29 23:53:25 Good question. I pulled the trigger here because i
return new Future.sync(() {
- var options = <String>['--categories=Client,Server', '--minify'];
+ var options = <String>['--categories=Client,Server'];
if (toDart) options.add('--output-type=dart');
+ if (minify) options.add('--minify');
+
if (packageRoot == null) {
packageRoot = path.join(path.dirname(entrypoint), 'packages');
}

Powered by Google App Engine