javascriptbowerwiredep

What to do when wiredep doesn't work


I've recently started using bower and wiredep. These guys play nicely together and usually work a treat.

I've come across the odd occasion where wiredep is not able to add the dependency, a recent example is:

"dependencies": {
    "slimScroll": "https://github.com/rochal/jQuery-slimScroll.git#~1.3.6",
  }

Is there a way to help wiredep wire these dependencies?


Solution

  • Not sure why this was down voted.

    The problem in this instance was that the package did not specify a main property in the bower.json

    For anyone interested you can add an override to your bower.json, adding in the main that was missing from the original package.

    "overrides": {
            "slimScroll":{
              "main":["jquery.slimscroll.js"]
            }
          }
    

    Just saw another example: The bootstrap 3.3.5 bower package does not reference any css files in the main property as a result wiredep can't add the css.