yeoman build:minify renames images -> angularjs ng-src fails

前端 未结 2 799
不知归路
不知归路 2020-12-28 18:47

I am using yeoman + angular and tried out \'yeoman build:minify\'. This fails because the task rev:img renames all images. Afterwards, the dynamic sources (see http://docs.a

2条回答
  •  借酒劲吻你
    2020-12-28 19:23

    In recent versions of Yeoman and its Gruntfile.js you can add folder of image to its filerev task. So that your filerev task looks like this:

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          /* Here you'll see some ignoring: */
          '!<%= yeoman.dist %>/images/some_image.png',
          '!<%= yeoman.dist %>/images/ignore',
          '<%= yeoman.dist %>/styles/fonts/*'
        ]
      }
    },
    

提交回复
热议问题