Question

I'm using the grunt file generated by yeoman angular-generator. There are multiple files need bower-install to update, the bower-install config is now like

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

I tried to use

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

And when running grunt bower-install, I got the following error

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

Aborted due to warnings.

The bower-install plugin version is

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

And my question is does this version support update multiple html files? If yes, how?

Was it helpful?

Solution

You can define multiple targets to update multiple html files like this:

'bower-install': {
  app: {
    html: '<%= yeoman.app %>/index.html',
    ignorePath: '<%= yeoman.app %>/'
  },
  app2: {
    html: '<%= yeoman.app %>/manager.html',
    ignorePath: '<%= yeoman.app %>/'
  }
}

OTHER TIPS

It looks like the latest version uses a much more flexible way of targeting files for injection...

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

target: {
    ...
    src: [
      'app/views/**/*.html',
    ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top