首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用grunt-bower-install更新多个html文件

如何使用grunt-bower-install更新多个html文件
EN

Stack Overflow用户
提问于 2014-03-31 12:00:45
回答 2查看 1.3K关注 0票数 1

我使用的是由约曼角发生器生成的咕噜文件。有多个文件需要bower-install更新,bower-install配置现在如下

代码语言:javascript
复制
// Automatically inject Bower components into the app
'bower-install': {
  app: {
    html: '<%= yeoman.app %>/index.html',
    ignorePath: '<%= yeoman.app %>/'
  }
},

我试着用

代码语言:javascript
复制
    html: ['<%= yeoman.app %>/index.html','<%= yeoman.app %>/manager.html']

在运行grunt bower-install时,我得到了以下错误

代码语言:javascript
复制
Running "bower-install:app" (bower-install) task
Warning: path must be a string Use --force to continue.

Aborted due to warnings.

bower-install插件版本是

代码语言:javascript
复制
"grunt-bower-install": "~0.7.0",

我的问题是这个版本支持更新多个html文件吗?如果是,怎么做?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-04-07 14:48:11

您可以定义多个目标来更新多个html文件,如下所示:

代码语言:javascript
复制
'bower-install': {
  app: {
    html: '<%= yeoman.app %>/index.html',
    ignorePath: '<%= yeoman.app %>/'
  },
  app2: {
    html: '<%= yeoman.app %>/manager.html',
    ignorePath: '<%= yeoman.app %>/'
  }
}
票数 2
EN

Stack Overflow用户

发布于 2014-04-23 06:25:04

看起来最新的版本使用了一种更加灵活的方式来锁定文件.

https://github.com/stephenplusplus/grunt-bower-install

代码语言:javascript
复制
target: {
    ...
    src: [
      'app/views/**/*.html',
    ...
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22761001

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档