Closed kennethlynne closed 8 years ago
Yeah, throwing would be a good idea here: https://github.com/taptapship/wiredep/blob/571d46975b4a8b0aa038b3b320c7970e97f537a7/wiredep-cli.js#L58. PR welcome.
For some reason I thought you were using the cli. bowerJson is supposed to be an object, the contents of your bower.json file.
@stephenplusplus @kennethlynne I'm having a similar problem with this folder structure:
├── client
│ ├── bower.json
│ ├── bower_components
│ └── src
├── gulpfile.js
├── package.json
└── server
In the gulpfile I was passing the options as paths like this:
var wiredepOptions = {
exclude: [/bootstrap.js$/, /bootstrap\.css/],
directory: 'client/bower_components',
bowerJson: 'client/bower.json'
};
but has been failing silently and nothing is injected in the html. Then after reading this thread I try to pass bower.json as an object with:
var jsonObj = require("./client/bower.json");
var wiredepOptions = {
exclude: [/bootstrap.js$/, /bootstrap\.css/],
directory: 'client/bower_components',
bowerJson: jsonObj
};
but fails warning about packages not installed ..
EDIT: Nevermind, I was writing a path wrongly. It works for me with:
bowerJson: require("./client/bower.json")
I am trying to configure wiredep to use a bower.json in another directory, and a custom bower_components directory. No success.
Throws ENOENT, no such file or directory '..../bower.json' :heavy_check_mark: