[英]Grunt - Wiredep Warning: “Must provide pattern”
I#m trying to get started using grunt together with bower to build my project. 我试图开始使用grunt和bower来构建我的项目。 So right now i simply want to inject all my installed bower packages into my index.html file using the grunt plugin wiredep.
因此,现在我只想使用grunt插件cableep将所有已安装的bower软件包注入到index.html文件中。
When i try to run the grunt command it always says: 当我尝试运行grunt命令时,它总是说:
Running "wiredep:target" (wiredep) task Warning: must provide pattern Use --force to continue.
运行“ wiredep:target”(wiredep)任务警告:必须提供模式使用--force才能继续。
Aborted due to warnings.
由于警告而中止。 Done.
完成。
I have found other topics with the same error, but none of the solutions seemed to work for me. 我发现了其他具有相同错误的主题,但是似乎没有一种解决方案适合我。
This is my grunfile
: 这是我的
grunfile
:
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
wiredep: {
target: {
src: '/public_html/index.html'
}
}
});
grunt.loadNpmTasks('grunt-wiredep');
};
This is my bower.json
: 这是我的
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": {}
}
This is my index.html: 这是我的index.html:
<!DOCTYPE html>
<head>
<!-- bower:css -->
<!-- endbower -->
</head>
<body>
<div class="container">
<div id="map"></div>
</div>
<!-- bower:js -->
<!-- endbower -->
</body>
Can someone tell me what's wrong? 有人可以告诉我怎么了吗?
The issue is with arcgis-js-api
. 问题出在
arcgis-js-api
。 Its bower.json does not provide a main
field which causes an issue with grunt-wiredep
. 它的bower.json不提供导致
grunt-wiredep
出现问题的main
字段。
https://github.com/taptapship/wiredep https://github.com/taptapship/wiredep
You will need to exclude it from your grunt-wiredep target or override and provide an appropriate main if it is to be linked. 您需要将其从grunt-wiredep目标中排除或覆盖,并提供适当的主体(如果要链接)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.