From d226fd18af66604a161c0f84db855ef6351e90ad Mon Sep 17 00:00:00 2001 From: David Glasser Date: Thu, 26 Mar 2015 13:56:29 -0700 Subject: [PATCH] Plugins register extensions, not filenames This particular piece of code (introduced in #1407) would decide that Plugin.registerSourceHandler('foo.bar') would match a file named 'foo.bar', but that was not the intention. In an app, the (correct) code in getSourcesFunc does expect the leading period to exist, so you end up with an odd situation where this code allows equal matches, but it only gets to see the file if it's in a package (not app) or if there's another plugin registering for 'bar'. Fixes #3985. --- tools/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/compiler.js b/tools/compiler.js index 13cc476219..96bbac5c60 100644 --- a/tools/compiler.js +++ b/tools/compiler.js @@ -358,7 +358,7 @@ var compileUnibuild = function (options) { var handler = null; if (! fileOptions.isAsset) { var parts = filename.split('.'); - for (var i = 0; i < parts.length; i++) { + for (var i = 1; i < parts.length; i++) { var extension = parts.slice(i).join('.'); if (_.has(allHandlersWithPkgs, extension)) { handler = allHandlersWithPkgs[extension].handler;