Index: pkg/polymer/lib/src/build/build_filter.dart |
diff --git a/pkg/polymer/lib/src/build/build_filter.dart b/pkg/polymer/lib/src/build/build_filter.dart |
index 4b50fe1caf86e83941a2fb619e88046ba675c586..8b7d56f8cadf628284f8b70132de106fee442d91 100644 |
--- a/pkg/polymer/lib/src/build/build_filter.dart |
+++ b/pkg/polymer/lib/src/build/build_filter.dart |
@@ -17,25 +17,22 @@ class BuildFilter extends Transformer with PolymerTransformer { |
final TransformOptions options; |
BuildFilter(this.options); |
- // TODO(nweiz): This should just take an AssetId when barback <0.13.0 support |
- // is dropped. |
- Future<bool> isPrimary(idOrAsset) { |
- var id = idOrAsset is AssetId ? idOrAsset : idOrAsset.id; |
- return new Future.value( |
- // nothing is filtered in debug mode |
- options.releaseMode && |
+ isPrimary(AssetId id) { |
+ // nothing is filtered in debug mode |
+ return options.releaseMode && |
// TODO(sigmund): remove this exclusion once we have dev_transformers |
// (dartbug.com/14187) |
- id.path.startsWith('web/') && |
+ !id.path.startsWith('lib/') && |
// may filter non-entry HTML files and internal artifacts |
- (id.extension == '.html' || id.extension == '.scriptUrls') && |
+ (id.extension == '.html' || id.extension == _DATA_EXTENSION) && |
// keep any entry points |
- !options.isHtmlEntryPoint(id)); |
+ !options.isHtmlEntryPoint(id); |
} |
- Future apply(Transform transform) { |
- if (transform.primaryInput.id.extension == '.scriptUrls') { |
- return new Future.value(null); |
+ apply(Transform transform) { |
+ transform.consumePrimary(); |
+ if (transform.primaryInput.id.extension == _DATA_EXTENSION) { |
+ return null; |
} |
return readPrimaryAsHtml(transform).then((document) { |
// Keep .html files that don't use polymer, since the app developer might |
@@ -46,3 +43,5 @@ class BuildFilter extends Transformer with PolymerTransformer { |
}); |
} |
} |
+ |
+const String _DATA_EXTENSION = '._data'; |