node.jsgruntjsgrunt-contrib-cssmin

Grunt grunt-contrib-cssmin runs unending doesn't combine files


I am having a strange issue with grunt-contrib-cssmin. It never stops or gives errors. I am using

C:\projects\doeclf>grunt --version && node --version && npm --version grunt-cli v0.1.13 grunt v0.4.5 v0.12.4 2.10.1

My grunt.js has following in it

  cssmin: {
            target: {
                files: [{
                    expand: true,
                    cwd: 'css/',
                    src: ['index.css', '!*.min.css'],
                    dest: 'css/',
                    ext: '.min.css'
                }]
            }
        }

My project structure is as follows

 |
 |
 grunt.js 
 |
 |__css
    |
    |__index.css  
 

When I run my grunt task this is the out it throws and it never finishes.

the output from my grunt cssmin --verbose is

    [4mInitializing[24m
Command-line options: [36m--verbose[39m

Reading "Gruntfile.js" Gruntfile...[32mOK[39m

[1mRegistering Gruntfile tasks.[22m
Reading package.json...[32mOK[39m
Parsing package.json...[32mOK[39m
Initializing config...[32mOK[39m

[1mRegistering "grunt-contrib-requirejs" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-contrib-requirejs\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-contrib-requirejs\package.json...[32mOK[39m
Loading "requirejs.js" tasks...[32mOK[39m
+ [36mrequirejs[39m

[1mRegistering "grunt-contrib-compass" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-contrib-compass\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-contrib-compass\package.json...[32mOK[39m
Loading "compass.js" tasks...[32mOK[39m
+ [36mcompass[39m

[1mRegistering "grunt-contrib-concat" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-contrib-concat\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-contrib-concat\package.json...[32mOK[39m
Loading "concat.js" tasks...[32mOK[39m
+ [36mconcat[39m

[1mRegistering "grunt-contrib-connect" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-contrib-connect\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-contrib-connect\package.json...[32mOK[39m
Loading "connect.js" tasks...[32mOK[39m
+ [36mconnect[39m

[1mRegistering "grunt-contrib-cssmin" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-contrib-cssmin\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-contrib-cssmin\package.json...[32mOK[39m
Loading "cssmin.js" tasks...[32mOK[39m
+ [36mcssmin[39m

[1mRegistering "csswring" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\csswring\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\csswring\package.json...[32mOK[39m
Loading "csswring.js" tasks...[32mOK[39m
+ [36mcsswring[39m

[1mRegistering "grunt-contrib-sass" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-contrib-sass\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-contrib-sass\package.json...[32mOK[39m
Loading "sass.js" tasks...[32mOK[39m
+ [36msass[39m

[1mRegistering "grunt-contrib-uglify" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-contrib-uglify\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-contrib-uglify\package.json...[32mOK[39m
Loading "uglify.js" tasks...[32mOK[39m
+ [36muglify[39m

[1mRegistering "grunt-contrib-watch" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-contrib-watch\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-contrib-watch\package.json...[32mOK[39m
Loading "watch.js" tasks...[32mOK[39m
+ [36mwatch[39m

[1mRegistering "grunt-express" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-express\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-express\package.json...[32mOK[39m

[1mRegistering "grunt-parallel" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-express\node_modules\grunt-parallel\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-express\node_modules\grunt-parallel\package.json...[32mOK[39m
Loading "parallel.js" tasks...[32mOK[39m
+ [36mparallel[39m
Loading "express.js" tasks...[32mOK[39m
+ [36mexpress[39m, [36mexpress-keepalive[39m, [36mexpress-restart[39m, [36mexpress-server[39m, [36mexpress-start[39m

[1mRegistering "grunt-open" local Npm module tasks.[22m
Reading C:\projects\doeclf\node_modules\grunt-open\package.json...[32mOK[39m
Parsing C:\projects\doeclf\node_modules\grunt-open\package.json...[32mOK[39m
Loading "open.js" tasks...[32mOK[39m
+ [36mopen[39m
Loading "Gruntfile.js" tasks...[32mOK[39m
+ [36mbuildsass[39m, [36mconcatcss[39m, [36mcssmin[39m, [36mdefault[39m, [36mserver[39m

Running tasks: [36mcssmin[39m

[4mRunning "cssmin" task[24m

[4mRunning "cssmin" task[24m

[4mRunning "cssmin" task[24m

[4mRunning "cssmin" task[24m

[4mRunning "cssmin" task[24m

Solution

  • Your target is fine and works perfectly, so the issue is somewhere else in your code.

    Specifically, your last line shows that you are redefining your own cssmin task Loading "Gruntfile.js" tasks...[32mOK[39m + [36mbuildsass[39m, [36mconcatcss[39m, [36mcssmin[39m, [36mdefault[39m, [36mserver[39m

    This probably causes the infinite looping, call your own task another name (mincss?) and you should be fine.