Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override function isn't load from config file #89

Open
leosuncin opened this issue Jan 8, 2016 · 0 comments
Open

override function isn't load from config file #89

leosuncin opened this issue Jan 8, 2016 · 0 comments

Comments

@leosuncin
Copy link

I have problems when use grunt-newer and grunt-contrib-compass on watch files, doesn't compile new files, well I read that I can use override function but doesn't make any effect, I didn't know why until run in verbose mode and see that override option is set to undefined.

  • grunt-cli v0.1.13
  • grunt v0.4.5
  • grunt-newer v1.1.1
  • node v0.12.9

tasks/config/newer.js

module.exports = function(grunt) {

    grunt.config.set('newer', {
        options: {
            cache: '.tmp/grunt-cache',
            override: function(detail, include) {
                grunt.verbose.writeln(detail);
                if (detail.task === 'less' || detail.task === 'compass') {
                    include(true);
                } else {
                    include(false);
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-newer');
};

tasks/config/watch.js

module.exports = function(grunt) {

    grunt.config.set('watch', {
        compass: {
            files: ['assets/styles/{,**/}*.scss'],
            tasks: ['newer:compass:dev', 'sails-linker:devStyles', 'notify:sass']
        },
        coffee: {
            files: ['assets/scripts/**/*.coffee'],
            tasks: ['newer:coffee:dev', 'sails-linker:devJs', 'notify:coffee']
        }
    });

    grunt.loadNpmTasks('grunt-contrib-watch');
};

Part of the output when run grunt in verbose mode
Imgur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant