From 7aafd68af84259050320df62614503a8f945ed8d Mon Sep 17 00:00:00 2001 From: Tim Blasi Date: Fri, 15 Jan 2016 11:05:20 -0800 Subject: [PATCH] feat(dart/transform): DirectiveProcessor: do not process generated files Prevent `DirectiveProcessor` from processing files which were generated by the Angular2 Dart transformer. --- modules_dart/transform/lib/src/transform/common/names.dart | 2 ++ .../lib/src/transform/directive_processor/transformer.dart | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules_dart/transform/lib/src/transform/common/names.dart b/modules_dart/transform/lib/src/transform/common/names.dart index 06c9e53730d3..1cc42f1f47c7 100644 --- a/modules_dart/transform/lib/src/transform/common/names.dart +++ b/modules_dart/transform/lib/src/transform/common/names.dart @@ -39,8 +39,10 @@ const ALL_EXTENSIONS = const [ bool isGenerated(String uri) { return const [ DEPS_EXTENSION, + META_EXTENSION, NON_SHIMMED_STYLESHEET_EXTENSION, SHIMMED_STYLESHEET_EXTENSION, + SUMMARY_META_EXTENSION, TEMPLATE_EXTENSION, ].any((ext) => uri.endsWith(ext)); } diff --git a/modules_dart/transform/lib/src/transform/directive_processor/transformer.dart b/modules_dart/transform/lib/src/transform/directive_processor/transformer.dart index d934d493af86..a3eda41a2723 100644 --- a/modules_dart/transform/lib/src/transform/directive_processor/transformer.dart +++ b/modules_dart/transform/lib/src/transform/directive_processor/transformer.dart @@ -28,7 +28,8 @@ class DirectiveProcessor extends Transformer implements LazyTransformer { DirectiveProcessor(this.options); @override - bool isPrimary(AssetId id) => id.extension.endsWith('dart'); + bool isPrimary(AssetId id) => + id.extension.endsWith('dart') && !isGenerated(id.path); @override declareOutputs(DeclaringTransform transform) {