0

I am using grunt to minify css.

However, when i try to change the parameter in the minify array from

ext: '.min.css' to ext: '.css' 

and

src: ['*.css', '!*.min.css'],

I am unable to minify the css. Does the '.min' matter?

My gruntfile is as below

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build: {
        files: [{
            expand: true,
            src: '**/*.js',
            dest: 'resources/front/js',
            cwd: 'assets/front/js'
        }]
      }
    },
   cssmin: {
      minify: {
        expand: true,
        cwd: 'assets/front/css/',
        src: ['*.css', '!*.min.css'],
        dest: 'resources/front/css/',
        ext: '.min.css'
      }
    }

    });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-cssmin');

  // Default task(s).
  grunt.registerTask('default', ['cssmin']);

};
kkh
  • 4,799
  • 13
  • 45
  • 73

1 Answers1

0

All I needed to do is to change

ext: '.min.css'

to

ext: '.css'
Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
kkh
  • 4,799
  • 13
  • 45
  • 73