From 78bfdf78eafe540fec6e1855830b0d61b8397aca 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. Closes #6517 --- 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 06c9e53730..1cc42f1f47 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 d934d493af..a3eda41a27 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) {