0

Grunt newbie here. I'm receiving the following error when I run the grunt task grunt-contrib-cssmin. The modernizr task seems to be working:

Running "cssmin:target" (cssmin) task
Warning: pattern.indexOf is not a function Use --force to continue.

Here is my gruntfile.js

module.exports = function(grunt) {
    grunt.initConfig ({
    // Do grunt-related things in here
        pkg: grunt.file.readJSON('package.json'),

        modernizr_builder: {
            build: {
                options: {
                    features: 'pointerevents',
                    dest: 'javascripts/modernizr-custom.js'
                }
            }
        },

        cssmin: {
          /*options: {
            shorthandCompacting: false,
            roundingPrecision: -1
          },*/
          target: {
            files: {
                files: {
                    'css/min/bigvideo.min.css': ['css/bigvideo.css']
                }
            }
          }
        },              
    });
    grunt.loadNpmTasks('grunt-modernizr-builder');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.registerTask('default',['modernizr_builder', 'cssmin']);
};

Here is my package.json file, I have the grunt-contrib-css installed in the project directory

{
  "name": "bootstrap-wp-less",
  "version": "1.0.0",
  "description": "No desc",
  "main": "index.js",
  "scripts": {
    "test": "test"
  },
  "author": "Me",
  "license": "ISC",
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-contrib-cssmin": "^0.14.0",
    "grunt-modernizr-builder": "^0.1.7"
  }
}
brandozz
  • 1,059
  • 6
  • 20
  • 38

1 Answers1

0

My error was in the cssmin task, changed to:

cssmin: {
          /*options: {
            shorthandCompacting: false,
            roundingPrecision: -1
          },*/
          target: {
            files: {
                'css/min/bigvideo.min.css': ['css/bigvideo.css']
            }
          }
        },  
brandozz
  • 1,059
  • 6
  • 20
  • 38