首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >咕噜- Wiredep警告:“必须提供模式”

咕噜- Wiredep警告:“必须提供模式”
EN

Stack Overflow用户
提问于 2017-03-21 14:41:11
回答 1查看 632关注 0票数 0

I#m试图开始使用grunt和bower一起构建我的项目。因此,现在我只想使用grunt插件wiredep将所有已安装的保龄球包注入我的index.html文件。

当我尝试运行grunt命令时,它总是这样说:

运行"wiredep:target“(wiredep)任务警告:必须提供模式使用--强制继续。 由于警告而中止。好了。

我发现了其他有同样错误的话题,但这些解决方案似乎都不适合我。

这是我的grunfile

代码语言:javascript
运行
复制
module.exports = function (grunt) {

    // Project configuration.
    grunt.initConfig({
        wiredep: {

            target: {
                src: '/public_html/index.html'
            }
        }
    });

    grunt.loadNpmTasks('grunt-wiredep');

};

这是我的bower.json

代码语言:javascript
运行
复制
{
  "name": "GeoSystem",
  "version": "1.0.0",
  "main": "/public_html/js/model.js",
  "ignore": [
    ".jshintrc",
    "**/*.txt"
  ],
  "dependencies": {"jQuery":"3.2.0",
    "arcgis-js-api": "4.3.0",
    "OpenLayers": "4.0.1",
    "bootstrap": "3.3.7"
  },
  "devDependencies": {}
}

这是我的index.html:

代码语言:javascript
运行
复制
<!DOCTYPE html>
<head>
    <!-- bower:css -->
    <!-- endbower -->
</head>
<body>
    <div class="container">
        <div id="map"></div>
    </div>

    <!-- bower:js -->
    <!-- endbower -->
</body>

有人能告诉我怎么回事吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-21 15:56:17

问题在于arcgis-js-api。它的bower.json不提供导致grunt-wiredep问题的main字段。

https://github.com/taptapship/wiredep

您将需要将其排除在您的咕噜-有线目标或覆盖,并提供一个适当的主,如果它要链接。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42930280

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档