ohboy21
ohboy21

Reputation: 4319

Dependency gets removed from bower

I am using AngularJS for my web app, and yeoman for setting up my environment. I want to add this markdown-directive to my dependencies. I installed everything, and still: in the bower.json file the entry is missing.

So i added the path to my file in

  1. bower.json (just the entry)

  2. karma.conf.js (the path)

and i also added the path in my index.html file. When i run grunt serve, the path in the index.html file gets removed and i'm getting this error message:

showdown was not injected in your file.
Please go take a look in "app/bower_components/showdown" for the file you need, then manually include it in your file.

What can i do so the link stays in my index.html file?

I know, i can add it after the server started, but every time i restart grunt, the script-tag gets deleted.

Upvotes: 1

Views: 293

Answers (2)

Santiago Angel
Santiago Angel

Reputation: 1127

I had the same problem and solved it but including an override inside the projects bower.json file telling it which file to use for showdown

"overrides": {
        "showdown": {
            "main": [
                "src/showdown.js"
            ]
        }
    }

Upvotes: 0

ohboy21
ohboy21

Reputation: 4319

Ok, i continued trying to fix this. What i found out:

Bower needs the *.js file in the root folder of the plugin. The showdown.js file was inside a "compressed" folder.

Maybe interesting for future "file was not injected" problems.

Upvotes: 2

Related Questions