These are chat archives for jescalan/roots

17th
Aug 2015
Michael Kornblum
@michaelkornblum
Aug 17 2015 05:21
Greetings and salutations all
Question has anyone attempted to integrate roots into a gulp setup?
Jeff Escalante
@jescalan
Aug 17 2015 09:58
Hi there @michaelkornblum! I don't think anyone has yet
what are you envisioning? most of the time gulp is not necessary when using roots. really roots is a tool that should replace gulp for web builds
Sigfried Gold
@Sigfried
Aug 17 2015 16:15
the server with roots watch is acting weird a lot for me. when I switch to something like live-server, my pages are getting built ok, but with the roots server, e.g., PDFs fail to load, images get mangled, I get segmentation faults. am I doing something especially egregious? do other people have this sort of problem?
Michael Kornblum
@michaelkornblum
Aug 17 2015 17:24
Hi, @jenius. The thing is, as much as I love roots there's still a few gulp plugins I'm not ready to part with yet. Namely, gulp-imagemin, gulp-svg-symbols and browser-sync( I know the last one is not a gulp plugin, but it's gulp friendly). As a result, I was envisioning an integration where I could use two gulp tasks within my build. One task that instantiates a roots project and another that triggers the compile command. Thus far, I've been to create the gulp task that triggers a roots build by using a simple child process exec command. The first task however is a bit over my head.
Mathias Biilmann
@biilmann
Aug 17 2015 17:27
@michaelkornblum haven’t tried doing it with roots (whenever I’m using roots it tends to be exactly to avoid dealing with a complex gulp file), but we did something like that for Jekyll for the netlify.com site - you can find the gulpfile here: https://github.com/netlify/netlify-home/blob/master/gulpfile.js
gulp's stream model can make these kinda things really tricky though, since it doesn’t map very well to a tool that transforms everything in several folders into lots of files in a new folder
Michael Kornblum
@michaelkornblum
Aug 17 2015 17:33
Thank you Bill. I actually tried using child-process spawn to trigger builds and ended up getting the the enoent error. Instead I used a child_process.exec() command, and that worked reasonably well. The sticking point however, is how to instantiate an entire roots instance from a gulp command. I can possibly live without that functionality, but I want to share this code with others and have some kind of command-line consistency.
Jeff Escalante
@jescalan
Aug 17 2015 20:20
Hi @Sigfried -- there's a weird bug in the latest roots version causing this issue. Run npm i roots@3.1.0 -g to fix this for now!
@michaelkornblum - minifying images is a one-time thing that can be done with imageoptim (google this). roots has its own livereload functionality. the only thing missing is svg-symbols. we'd be happy to work on a plugin for this. would you be willing to contribute?
Sigfried Gold
@Sigfried
Aug 17 2015 21:25
Thanks