jackfranklin / gulp-load-plugins

Automatically load in gulp plugins
https://github.com/jackfranklin/gulp-load-plugins
MIT License
757 stars 55 forks source link

Throw an informative error on missing modules. #68

Closed connor4312 closed 9 years ago

connor4312 commented 9 years ago

Previously, if you forgot to npm install after a pull and gulped, it'd throw a rather cryptic error when a package was not found:

 AssertionError: path must be a string
    at Module.require (module.js:362:3)
    at require (module.js:380:17)
    at requireFn (C:\Users\Connor\Documents\GitHub\beam-widgets\node_modules\gulp-load-plugins\index.js:37:14)
    at Object.defineProperty.get (C:\Users\Connor\Documents\GitHub\beam-widgets\node_modules\gulp-load-plugins\index.js:59:18)
...

Now, it throws a nice one!

Error: Cannot find `gulp-istanbul` in your node_modules!
jackfranklin commented 9 years ago

I've been wanting this for ages, thank you! Do you fancy adding a spec?

connor4312 commented 9 years ago

Sure, one minute...

connor4312 commented 9 years ago

There you go. Grouped in a new section for "common" functionality not specific to lazy loading.

jackfranklin commented 9 years ago

Will merge this along with #69 and then get a new release out :+1:

jackfranklin commented 9 years ago

@connor4312 unfortunately my merging of the other PR caused a conflict with this one. If you get a sec would you mind rebasing and pushing up? Sorry about this.

jackfranklin commented 9 years ago

@connor4312 went ahead and rebased - this is now landed in https://github.com/jackfranklin/gulp-load-plugins/commit/bb9a5c591e74fd9bde199e05f811df9e13757e56. Thanks !