Grunt-contrig-imagemin Warning: it is not possible to call the "replace" method from undefined

I get a strange warning when I try to use imagemin, and nothing happens.

grunt imagemin:primary

Warning: Cannot call method 'replace' of undefined Used --force, continuing.
Done, but with warnings.

My task, which gives me an error, is as follows

  grunt.config 'imagemin'

    primary:
      options:
        optimizationLevel: 7
      expand: true
      cwd: "assets"
      src: "{img,img_two}/**/*.{jpg,jpeg,gif,png}"
      dest: "public/compiled/img"


  grunt.loadNpmTasks 'grunt-contrib-imagemin'

They do not work

src: "img/**/*.{jpg,jpeg,gif,png}"

src: "{img,img_two}/**/*.{jpg,jpeg,gif,png}"

These works

src: "img/**/*.jpg"

src: "{img,img_two}/**/*.jpg"

It seems like this doesn't look like the syntax of several extensions, but why, even how was this done in the example?

UPDATE: PNG does not seem to work, regardless of whether I am performing the extension myself or within a group. I am on Windows 8, NPM 1.4.3

https://github.com/gruntjs/grunt-contrib-imagemin/issues/219

+4
source share
1 answer

, grunt-contrib-imagemin, node_modules

"npm install grunt-contrib-imagemin", .

+11

Source: https://habr.com/ru/post/1540918/


All Articles