目前的项目结构有点像这样:
-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 依赖项的文件的有效方法是什么?
您可以执行两个不同的任务,每个任务都有自己的依赖项(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",
...
}
}
}}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)