Giter Site home page Giter Site logo

grunt-focus's People

Contributors

igorraush avatar joeytrapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

grunt-focus's Issues

Exclude or include has no effect

Hi,

It seems (in my case) that the watch task is not filtered by the task focus. Here's a part of my GruntFile :

    focus: {
        website: {
            exclude: ['html']
        },
        dev: {
            exclude: ['htmlWebsite']
        }
    },


    // Watch files for changes and launch related tasks ------------------------------------
    watch: {

        styles: {
            files: ['src/**/*.css', 'src/**/*.less'],
            tasks: ['newer:less', 'newer:autoprefixer', 'processhtml:css', 'notify:watch']
        },

        scripts: {
          files: 'src/**/*.js',
          tasks: ['newer:jshint:dev', 'uglify:dev', 'notify:watch']
        },


        html : {
          files: ['src/**/*.html'],
          tasks: ['processhtml:dev', 'merge-json', 'replace', 'notify:watch']
        },

        htmlWebsite : {
          files: ['src/**/*.html'],
          tasks: ['processhtml', 'merge-json', 'replace', 'notify:watch']
        }
    },

The task that calls focus is registered like this :

grunt.registerTask('server', 'local server', function(target){
    target = target || 'website';
    grunt.task.run(['connect', 'focus:'+target]);
});

But the output shows that both processhtml tasks for html files are ran (while only processhtml:website task should run) :

Running "server" task

Running "connect:server" (connect) task
Started connect web server on http://0.0.0.0:8000

Running "focus:website" (focus) task

Running "watch" task
Waiting...
>> File "src/html/home.html" changed.
Running "processhtml:dev" (processhtml) task

Running "processhtml:website" (processhtml) task

Any ideas ?
PS : i tried with both exclude or include options

Node version : v0.10.32
Grunt version : 0.4.5
Grunt CLI version : 0.1.13
grunt-focus version : 0.1.1
grunt-contrib-watch version : 0.6.1

ObjectFilter drops task-level options

If I configure the focus task to include some watch targets, then all keys from the watch config which are not present in the array are dropped. This means that only target-level options can be used, task-level options are dropped.

Depending on how generic you'd like to keep ObjectFilter, we can either automatically push "options" into the include config, or add another option to ObjectFilter which will preserve/ignore certain keys.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.