capaj / require-globify

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

Wont work when path is ./**/*.js #8

Closed blessanm86 closed 9 years ago

blessanm86 commented 9 years ago

Its seems the module fails if the require path is set to ./**/*.js. But it works if I change it to ./home/**/*.js.

The following is my directory structure

- source.js
- home/
    - car.js
    - fruit.js

Here is the content of source.js

var controllers = require('./**/*.js', {hash: 'path', ext: true});

The following is the error I get

Error: Parsing file G:\Dev\dyn-req\node_modules\require-globify\node_modules\browserify-transform-tools\testFixtures\testWithConfig\syntaxError.js: Unexpected token (2:15)
    at Deps.parseDeps (C:\Users\Blessan\AppData\Roaming\npm\node_modules\browserify\node_modules\module-deps\index.js:425:28)
    at fromSource (C:\Users\Blessan\AppData\Roaming\npm\node_modules\browserify\node_modules\module-deps\index.js:368:48)
    at C:\Users\Blessan\AppData\Roaming\npm\node_modules\browserify\node_modules\module-deps\index.js:363:17
    at ConcatStream.<anonymous> (C:\Users\Blessan\AppData\Roaming\npm\node_modules\browserify\node_modules\concat-stream\index.js:36:43)
    at ConcatStream.emit (events.js:129:20)
    at finishMaybe (C:\Users\Blessan\AppData\Roaming\npm\node_modules\browserify\node_modules\readable-stream\lib\_stream_writable.js:460:14)
    at endWritable (C:\Users\Blessan\AppData\Roaming\npm\node_modules\browserify\node_modules\readable-stream\lib\_stream_writable.js:469:3)
    at ConcatStream.Writable.end (C:\Users\Blessan\AppData\Roaming\npm\node_modules\browserify\node_modules\readable-stream\lib\_stream_writable.js:436:5)
    at DuplexWrapper.onend (C:\Users\Blessan\AppData\Roaming\npm\node_modules\browserify\node_modules\readable-stream\lib\_stream_readable.js:537:10)
    at DuplexWrapper.g (events.js:199:16)
call-a3 commented 9 years ago

Ok, I'll look into it. Thanks for reporting!

call-a3 commented 9 years ago

Should be fixed in 1.2.0. I'm deploying the new version when TravisCI comes back up (it's momentarily down for maintenance) and it gives the all-green.

blessanm86 commented 9 years ago

:+1: thanks.