Using a single gulpfile across projects

837 views Asked by At

Our startup uses gulp as a build system across multiple projects built using AngularJS (admin, mobile, web). These projects all use the same gulpfile. When we make changes to one, we usually upgrade them in each repository.

Is there a way to put our gulp build system into version control, and possibly use bower to distribute this between our apps?

I did come across https://github.com/gulpjs/gulp/blob/master/docs/recipes/split-tasks-across-multiple-files.md

What would be the cleanest way to do this?

1

There are 1 answers

0
Ghidello On

An option would be to use git-submodule for embedding your gulpfile repository in your multiple projects but I found more consistent to use bower as you suggested.

The bower.js file allows you to reference a package in a custom git repository both as an URL or as a PATH so you're free to host your bower packages basically everywhere you want:

{
    dependencies: {
        "gulpfileURL":"git://custom-git-repo.com/gulpfile1#branchName", //branchName as **master** as default value
        "gulpfilePATH":"file:///local/git/repository/path/.git/"
    }
}