joeytrapp / grunt-focus Goto Github PK
View Code? Open in Web Editor NEWConfigure subsets of watch configs and focus your Grunt processes
License: MIT License
Configure subsets of watch configs and focus your Grunt processes
License: MIT License
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.