0

Basically, at the beginning all is ok but after modifications, CSS are not updated.

First, my package details:

"node" : "0.10.21" 
[...]
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-less": "~0.8.1"

Next, my gruntfile.js

module.exports = function(grunt) {

grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    concat: {
        options: {
            separator: ''
        },
        dist: {
            src: [  'src/js/libs/jquery-2.0.3.min.js',
                    'src/js/libs/**/*.js',
                    'src/js/app/**/*.js'],
            dest: 'public/js/combo.js'
        }
    },
    uglify: {
        options: {
            banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
        },
        dist: {
            files: {
                'public/js/combo.min.js': ['public/js/combo.js']
            }
        }
    },
    less: {
        compile: {
            options: {
                compress:true
            },
            files: {
                'public/css/application.css': ['src/css/application.less']
            }
        }
    },
    jshint: {
        files: ['gruntfile.js', 'src/js/**/*.js','src/css/**/*.less','public/index.html'],
        options: {
            globals: {
                jQuery: true,
                console: true,
                module: true,
                document: true
            }
        }
    },
    watch: {
        files: ['<%= jshint.files %>'],
        tasks: ['default']
    }
});

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', ['concat','uglify','less','watch']);

};

Explanations

At first, all works perfectly, all the files are created:

Running "concat:dist" (concat) task
File "public/js/combo.js" created.

Running "uglify:dist" (uglify) task
File "public/js/combo.min.js" created.

Running "less:compile" (less) task
App runnning on http://localhost:3000
File public/css/application.css created.

Running "watch" task
Waiting...

But, if I make a modification in my *.less files:

OK
>> File "src\css\application.less" changed.

Running "concat:dist" (concat) task
Completed in 2.039s at Tue Nov 12 2013 11:44:53 GMT-0500 (Eastern Standard Time) - Waiting...

So, modifying is detected by watch but my CSS file is not updated and I just can't figure why. I tried several contrib-less implementations and it keeps the same way. I guess I'm doing something wrong but what ?

PS: concat and uglify are working very well.

PRASS
  • 315
  • 3
  • 7

0 Answers0