Bower Interdependence in HTML with Grunt

I installed AngularJS through the Yeoman forests. When i started

grunt bower-install

It only reflects HTML dependencies that are in bower.json in the "dependencies" section. How can I do this, including the depot in the "devDependencies" section?

+4
source share
3 answers

As stated in the Angular changelog, bower-install is deprecated in version 9.0.0 see here , now the installation task of bower-install is deprecated and should be replaced with wiredep. Modify the Gruntfile.js file as follows:

wiredep: {
  options: {
    cwd: '<%= yeoman.app %>'
  },
  dev: {
    devDependencies: true,
    src: ['<%= yeoman.app %>/index.html'],
    ignorePath:  /\.\.\//
  },
  app: {
    src: ['<%= yeoman.app %>/index.html'],
    ignorePath:  /\.\.\//
  },
  sass: {
    src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
    ignorePath: /(\.\.\/){1,2}bower_components\//
  }
},

And now install DevDependencies with

grunt wiredep: dev

+3
source

-, 50 , , , , , , gruntfile.js

grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    ...

    grunt.task.run([
      'clean:server',
      'wiredep:dev', <-- Changed this from plain 'wiredep'
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });
+2

If you correctly installed the Yeoman generator (check for errors in your log), then all the dependencies will be installed, including those listed in the "devDependencies" section. Otherwise, delete the entire folder bower_components, make sure that bower.jsonthere are no syntax errors in yours and just run

bower install

in the root directory. This will install everything.

0
source

All Articles