I use Gulp JS in my themes but the issue I'm having is we work on many themes in our drupal site (sometimes up to 40!).
I want to avoid repeating the same "node_modules", "gulpfile.js" and "package.json" files in every single theme. If we want to change 1 of those files, we would have to update each file in every theme across all sites which is going to get too messy.
I would like to have the Gulp files live in sites/all/libraries and have gulp watch my theme that I'm working on.
To anyone experienced with Gulp, any idea's on how this can work?
Edit:
- I have moved the 2 gulp files & node_modules folder into /sites/all/libraries/gulp
- I have edited gulp.js to point to the theme I'm working on, code is below (I have tried a few different combinations including an absolute path):
gulp.task('less', function() { gulp.src('../themes/theme_name/css/style.less')
When I type gulp in the command line in my theme directory I get this error:
Local gulp not found in /var/www/site_name/sites/all/themes/theme_name
If I go into sites/all/libraries/gulp, type gulp in the command line, the gulp process starts, but if I edit a Less file and save it, gulp doesn't compile the css.
Thank You
gulp.cwd(...)
to/var/www/site_name/sites/all/themes
? I use grunt myself but I'm guessing (hoping) gulp has the same philosophy