I am testing the plugin grunt-contrib-imagemin for jpg minify. But it always failed as Running "imagemin:dynamic" (imagemin) task Fatal error: This socket is closed.
Source :
 grunt.initConfig({
        imagemin: { // Task
           dynamic: {                         // Another target
        files: [{
        expand: true,                  // Enable dynamic expansion
        cwd: 'src/',                   // Src matches are relative to this path
        src: ['**/*.{png,jpg,gif}'],   // Actual patterns to match
        dest: 'dist/'                  // Destination path prefix
      }]
    }
        }
    });
Try re-installing grunt-contrib-imagemin:
npm cache clean
npm install grunt-contrib-imagemin --save-dev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With