actum / gulp-dev-stack

Actum dev stack based on gulp
MIT License
11 stars 7 forks source link

Passing only changed files to tasks #51

Closed kettanaito closed 7 years ago

kettanaito commented 8 years ago

How about filtering the files and passing only those changed into various tasks? Should be pretty resource- and time-efficient.

There are usually plugins for that. Here is the one I've found right away: https://www.npmjs.com/package/gulp-changed.

janpanschab commented 8 years ago

Which tasks do you mean exactly? In JS task it is solved by browserify/watchify.

kettanaito commented 8 years ago

@janpanschab I am talking about some changes checker, which passes only those files which changed to the appropriate tasks. Maybe Gulp runs this automatically, but I remember this being somewhat an issue in Grunt.

Basically, something like this (https://github.com/sindresorhus/gulp-changed) may allow to process only changed files through tasks. For example, if you have been working on some index.tpl file, and hit "Save", with this sort or plugins only this index.tpl will run through templating engine, and all the other templates will not. This may potentially save time, I presume.

janpanschab commented 7 years ago

@kettanaito I think it is not possible to use it for templates because imagine when you change some partial template - what should be done? You need to change all pages where this partial is used. AFAIK this approach is useable only on some types of tasks (e.g. linting).

kettanaito commented 7 years ago

@janpanschab a good point. And what do you think about other instances?

janpanschab commented 7 years ago

It make sense in eslint task, icon (svgmin only) task and stylelint task.

vbulant commented 7 years ago

Already implemented in stylelint and eslint.