capaj / require-globify

transform for browserify, which allows to require files with globbing expressions
MIT License
70 stars 11 forks source link

hash does not work when only one file in the required directory #13

Closed mparpaillon closed 9 years ago

mparpaillon commented 9 years ago

Apparently when you require a directory which only has a single file, then the key appears with the full relative path and no extension, whatever your resolve options are.

Here is the test case (Bug only shows up when only one file in the target directory):

// Input
var templates = require('./templates/*.hbs', { mode: 'hash' });

// Output
var templates =  {
    './templates/zoning': require('./templates/zoning.hbs')
};

// Output expected
var templates =  {
    'zoning.hbs': require('./templates/zoning.hbs')
};

I know ! You want tests, screenshots of it, photo of me getting the bug while evil laughing. But I already lost too much time on this bug so do whatever you want with that information.

call-a3 commented 9 years ago

I think you're exaggerating my expectations of a bug report, but I understand if you feel annoyed by my response on your previous bug report. I think I have everything I need from this report, so I'll look in to it as fast as I can ;)