1

私は、yeoman angular-generator によって生成された grunt ファイルを使用しています。更新するために bower-install が必要な複数のファイルがあり、bower-install 構成は次のようになりました

// Automatically inject Bower components into the app
'bower-install': {
  app: {
    html: '<%= yeoman.app %>/index.html',
    ignorePath: '<%= yeoman.app %>/'
  }
},

使ってみた

    html: ['<%= yeoman.app %>/index.html','<%= yeoman.app %>/manager.html']

を実行するgrunt bower-installと、次のエラーが発生しました

Running "bower-install:app" (bower-install) task
Warning: path must be a string Use --force to continue.

Aborted due to warnings.

bower-install プラグインのバージョンは

"grunt-bower-install": "~0.7.0",

私の質問は、このバージョンは複数の html ファイルの更新をサポートしていますか? はいの場合、どのように?

4

2 に答える 2

2

次のように、複数のターゲットを定義して、複数の html ファイルを更新できます。

'bower-install': {
  app: {
    html: '<%= yeoman.app %>/index.html',
    ignorePath: '<%= yeoman.app %>/'
  },
  app2: {
    html: '<%= yeoman.app %>/manager.html',
    ignorePath: '<%= yeoman.app %>/'
  }
}
于 2014-04-07T14:48:11.463 に答える
1

最新バージョンでは、注入対象のファイルをより柔軟な方法で使用しているようです...

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

target: {
    ...
    src: [
      'app/views/**/*.html',
    ...
于 2014-04-23T06:25:04.197 に答える