taptapship / wiredep

Wire Bower dependencies to your source code.
MIT License
1.15k stars 142 forks source link

ignoredDependencies in .bowerrc file leads to an error #233

Closed bbuhler closed 8 years ago

bbuhler commented 8 years ago

I have created an .bowerrc file like described here.

{
  "ignoredDependencies": [
    "bootstrap-sass",
    "jquery"
  ]
}

When I run wiredep it raises the following error:

Error: Error: bootstrap-sass is not installed. Try running `bower install` or remove the component from your bower.json file.

Even when I configure the ignored components to be excluded in wiredep.

eddiemonge commented 8 years ago

Where did you get ignoredDependencies from? Use exclude https://github.com/taptapship/wiredep#configuration

bbuhler commented 8 years ago

@eddiemonge the ignoredDependencies property are in my .bowerrc configuration file. (See http://bower.io/docs/config/#bowerrc-specification)

As I tried to mention I use the exclude property of wiredep configuration.

Using exclude does not solve the error. Please re-open this issue.

eddiemonge commented 8 years ago

What is your configuration? How are you using exclude?

bbuhler commented 8 years ago

I created a test repo where you can reproduce the error as follows:

I use the following configuration for wiredep, running via gulp:

{
  exclude: [/jquery/, /bootstrap/]
}
eddiemonge commented 8 years ago

Interesting. So the problem is that one of your dependencies require an excluded dependency. Because of that, wiredep is trying to go into that second dependency to determine what its dependencies are. So even though the parent is being excluded, it will still try to include its children. I'm not sure if this is an actual bug or an awesome feature.

eddiemonge commented 8 years ago

So the short answer is to install them using bower then they wont get added because of the exclude.

moravcik commented 8 years ago

I have the same problem. I think wiredep should accept Bower's standard way of ignoring dependencies (via ignoredDependencies in .bowerrc) or at least do not raise errors for missing dependencies which are stated to exclude. Installing dependencies with bower and using only exclude as it was suggested is not perfect in my case, since I use other gulp tasks to scan all bower_components and so I need to exclude the same dependencies in multiple places, which I think is not the best practice.

yumyo commented 7 years ago

Ignoring dependencies via bower overrides fix the issue for me.

Eg. to wiredep fullpage.js without jquery.

"fullpage.js": {
    "main": [
        "./dist/jquery.fullpage.min.js"
    ],
    "dependencies": {}
},
shishirsharma commented 6 years ago

https://github.com/taptapship/wiredep/issues/233#issuecomment-198026349 Solves my problem.