gruntjsgrunt-contrib-cssmin

Grunt: cssmin not working


I am trying to minify CSS using Grunt cssmin plugin. Below is my code:

// Minify CSS
cssmin: {
    build: {
        options: {
            banner: '/* Minified CSS */'
        },

        files: {
            'htt/css/style.min.css' : ['wp/css/**/*.css']
        }   
    }
},

when i run "grunt cssmin" it gives error of "Unexpected identifier".


Solution

  • You where missing a comma after the js object in the watch task, for future you can edit your answer to provide more information instead of posting it as an answer :)

            // Watch Tasks
            watch: {
                js: {
                    files: ['wp/js/*.js'],
                    tasks: ['uglify:dev']
                }, <------- Missing comma
    
                css: {
                    files: ['wp/css/*.css'],
                    tasks: ['']
                }
            }
        });