[英]Grunt - Wiredep Warning: “Must provide pattern”
我试图开始使用grunt和bower来构建我的项目。 因此,现在我只想使用grunt插件cableep将所有已安装的bower软件包注入到index.html文件中。
当我尝试运行grunt命令时,它总是说:
运行“ wiredep:target”(wiredep)任务警告:必须提供模式使用--force才能继续。
由于警告而中止。 完成。
我发现了其他具有相同错误的主题,但是似乎没有一种解决方案适合我。
这是我的grunfile
:
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
wiredep: {
target: {
src: '/public_html/index.html'
}
}
});
grunt.loadNpmTasks('grunt-wiredep');
};
这是我的bower.json
:
{
"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:
<!DOCTYPE html>
<head>
<!-- bower:css -->
<!-- endbower -->
</head>
<body>
<div class="container">
<div id="map"></div>
</div>
<!-- bower:js -->
<!-- endbower -->
</body>
有人可以告诉我怎么了吗?
问题出在arcgis-js-api
。 它的bower.json不提供导致grunt-wiredep
出现问题的main
字段。
https://github.com/taptapship/wiredep
您需要将其从grunt-wiredep目标中排除或覆盖,并提供适当的主体(如果要链接)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.