【问题标题】:Dependency gets removed from bower从凉亭中删除依赖项
【发布时间】:2014-03-16 22:50:55
【问题描述】:

我将 AngularJS 用于我的 Web 应用程序,并使用 yeoman 来设置我的环境。我想将此markdown-directive 添加到我的依赖项中。我安装了所有东西,但仍然:在 bower.json 文件中缺少条目。

所以我将路径添加到我的文件中

  1. bower.json(只是入口)

  2. karma.conf.js(路径)

我还在我的 index.html 文件中添加了路径。当我运行 grunt serve 时,index.html 文件中的路径被删除,我收到以下错误消息:

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.

我该怎么做才能使链接保留在我的 index.html 文件中?

我知道,我可以在服务器启动后添加它,但是每次我重新启动 grunt 时,script-tag 都会被删除。

【问题讨论】:

    标签: javascript json angularjs


    【解决方案1】:

    好的,我继续尝试解决此问题。我发现了什么:

    Bower 需要插件根文件夹中的 *.js 文件。 showdown.js 文件位于“压缩”文件夹中。

    也许对未来的“文件未注入”问题很感兴趣。

    【讨论】:

    • 这是我讨厌凉亭的一件事。没有标准化。
    【解决方案2】:

    我遇到了同样的问题并解决了它,但在项目 bower.json 文件中包含一个覆盖,告诉它使用哪个文件进行摊牌

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-24
      相关资源
      最近更新 更多