当前的项目结构有点像这样:
-index.html
|
-bower.json
|
+-bower_components建议的项目结构将在项目根目录中添加更多的静态html文件。到目前为止,我一直在管理bower.json中的所有前端依赖项,并使用grunt-wiredep任务将其自动包含在index.html中。但随着新文件的添加,每个文件将具有不同的依赖关系集。
-index.html
|
-file-with-some-other-bower-dependency.html
|
-bower.json
|
+bower_components管理这些具有不同bower依赖关系的文件的有效方法是什么?
发布于 2016-03-16 21:33:41
您可以执行两个不同的任务,每个任务都有自己的依赖项(bowerJson):
grunt.initConfig({
wiredep: {
app: {
src: 'index.html',
"bowerJson":{
"dependencies": {
"jquery":"=2.1.3",
...
}
}
},
app2: {
src: 'file-with-some-other-bower-dependency.html',
"bowerJson": {
"dependencies": {
"bootstrap": "~3.0.0",
...
}
}
}}https://stackoverflow.com/questions/30342126
复制相似问题