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.
This commit is contained in:
David Glasser
2015-03-26 13:56:29 -07:00
parent 47c62e94d9
commit d226fd18af

View File

@@ -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;