문제

Composer is a great tool for dependency management but for local development it can become time consuming to keep running it to update builds. There are ways round this such as symlinking, but with build tools like gulp it seems there should be better ways to monitor changes to local libraries.

Watching a local library makes sense but composer bases it's update decisions on the latest git commit, not on the current state of the working directory. How can I have a gulp watch task update my dependencies?

도움이 되었습니까?

해결책

Turns out that you can simply watch the git reference, as long as your composer dependency is bound to a specific branch:

gulp.watch([
    '/path/to/local/lib/.git/refs/heads/master',
    '/path/to/other/lib/.git/refs/heads/dev',
],['composer']);

Where the composer task is defined

var composer = require('gulp-composer');
gulp.task('composer',function(){
    composer('update',{bin:'php composer.phar'});
});

Solutions which also watch packagist.org would be greatly appreciated and may even beat out my own!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top