mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user