【问题标题】:Bower is not updating in Visual Studio 2015 CTP 6Bower 未在 Visual Studio 2015 CTP 6 中更新
【发布时间】:2015-03-11 12:38:19
【问题描述】:

我刚刚在 Visual Studio 2015 CTP6 中使用 Bower 安装了 React。 在 Dependencies -> Bower -> React (0.13.0) 我确实有 React 包。(js 文件也在磁盘上的 bower_components/react 文件夹中)

当我尝试添加脚本 <script src="~/lib/ 时,我的脚本列表中没有 React。

智能不工作且 JavaScript 未加载。

【问题讨论】:

    标签: bower visual-studio-2015


    【解决方案1】:

    在这个示例中,我添加了一个简单的规则来复制所有 .js 文件:

    {
        "name": "WebApplication",
        "private": true,
        "dependencies": {
            "bootstrap": "3.0.0",
            "jquery": "1.10.2",
            "jquery-validation": "1.11.1",
            "jquery-validation-unobtrusive": "3.2.2",
            "hammer.js": "2.0.4",
            "bootstrap-touch-carousel": "0.8.0",
            "react": "~0.13.1"
        },
        "exportsOverride": {
            "bootstrap": {
                "js": "dist/js/*.*",
                "css": "dist/css/*.*",
                "fonts": "dist/fonts/*.*"
            },
            "bootstrap-touch-carousel": {
                "js": "dist/js/*.*",
                "css": "dist/css/*.*"
            },
            "hammer": {
                "": "hammer.{js,min.js}"
            },
            "react": {
                "":  "*.js"
            }
    
        }
    }
    

    结果是,当您运行 install bower 任务时,您会在 wwwroot/lib 中找到一个名为 react 的目录,其中仅包含 .js 文件。

    【讨论】:

      【解决方案2】:

      我想你已经在 bower.json 中配置了 exportsOverride 部分

      【讨论】:

      • 你能给我举个例子吗?谢谢
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-27
      • 1970-01-01
      • 1970-01-01
      • 2014-07-26
      • 1970-01-01
      • 2017-02-21
      相关资源
      最近更新 更多