I#m试图开始使用grunt和bower一起构建我的项目。因此,现在我只想使用grunt插件wiredep将所有已安装的保龄球包注入我的index.html文件。
当我尝试运行grunt命令时,它总是这样说:
运行"wiredep:target“(wiredep)任务警告:必须提供模式使用--强制继续。 由于警告而中止。好了。
我发现了其他有同样错误的话题,但这些解决方案似乎都不适合我。
这是我的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>
有人能告诉我怎么回事吗?
发布于 2017-03-21 15:56:17
问题在于arcgis-js-api
。它的bower.json不提供导致grunt-wiredep
问题的main
字段。
https://github.com/taptapship/wiredep
您将需要将其排除在您的咕噜-有线目标或覆盖,并提供一个适当的主,如果它要链接。
https://stackoverflow.com/questions/42930280
复制相似问题