[flutter_tools] supports tree-shake-icons for web builds (#51808)

* [flutter_tools] supports tree-shake-icons for web builds

* Update compile.dart

* fix icon_tree_shaker
This commit is contained in:
Jonah Williams
2020-03-05 12:35:04 -08:00
committed by GitHub
parent 1bf6f0232e
commit aed961993d
4 changed files with 195 additions and 148 deletions

View File

@@ -11,6 +11,7 @@ import '../base/logger.dart';
import '../build_info.dart';
import '../build_system/build_system.dart';
import '../build_system/targets/dart.dart';
import '../build_system/targets/icon_tree_shaker.dart';
import '../build_system/targets/web.dart';
import '../convert.dart';
import '../globals.dart' as globals;
@@ -52,8 +53,7 @@ Future<void> buildWeb(
kHasWebPlugins: hasWebPlugins.toString(),
kDartDefines: jsonEncode(dartDefines),
kCspMode: csp.toString(),
// TODO(dnfield): Enable font subset. We need to get a kernel file to do
// that. https://github.com/flutter/flutter/issues/49730
kIconTreeShakerFlag: buildInfo.treeShakeIcons.toString(),
},
));
if (!result.success) {