| Index: pkg/polymer/lib/src/build/script_compactor.dart
|
| diff --git a/pkg/polymer/lib/src/build/script_compactor.dart b/pkg/polymer/lib/src/build/script_compactor.dart
|
| index 01885f747dbc39b1db97626d57423240499f0ee8..8ac8fd0d1dbd0b67d033e59ddd27eb119f9fc1c0 100644
|
| --- a/pkg/polymer/lib/src/build/script_compactor.dart
|
| +++ b/pkg/polymer/lib/src/build/script_compactor.dart
|
| @@ -81,7 +81,10 @@ class ScriptCompactor extends Transformer with PolymerTransformer {
|
| mainScriptTag.attributes['src'] =
|
| path.url.basename(bootstrapId.path);
|
|
|
| - libraries.add(mainLibraryId);
|
| + // TODO(sigmund): stop renaming the file (see dartbug.com/14554)
|
| + var modifiedMainId = mainLibraryId.addExtension('_modified.dart');
|
| +
|
| + libraries.add(modifiedMainId);
|
| var urls = libraries.map((id) => assetUrlFor(id, bootstrapId, logger))
|
| .where((url) => url != null).toList();
|
| var buffer = new StringBuffer()..writeln(MAIN_HEADER);
|
| @@ -95,12 +98,17 @@ class ScriptCompactor extends Transformer with PolymerTransformer {
|
| ..writeln(' configureForDeployment([')
|
| ..writeAll(urls.map((url) => " '$url',\n"))
|
| ..writeln(' ]);')
|
| - ..writeln(' i${i - 1}.main();')
|
| + ..writeln(' i${i - 1}.polymerMainWrapper();')
|
| ..writeln('}');
|
|
|
| transform.addOutput(new Asset.fromString(
|
| bootstrapId, buffer.toString()));
|
| transform.addOutput(new Asset.fromString(id, document.outerHtml));
|
| +
|
| + return transform.readInputAsString(mainLibraryId).then((contents) {
|
| + transform.addOutput(new Asset.fromString(modifiedMainId,
|
| + '$contents\n\npolymerMainWrapper() => main();\n'));
|
| + });
|
| });
|
| });
|
| }
|
|
|