Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Boris Kamp
Boris Kamp
16,660 Points

Gulp copy or import vendor plugins for use in build

Hi guys!

I'm setting up my own Gulp workflow based on this https://github.com/synapticism/wordpress-gulp-starter-kit starter kit. I want to include the following modules in my builds conditionally:

  1. Bootstrap partials
  2. ParsleyJS
  3. Photoswipe

I've installed them all with npm install, now I wonder how I should inlcude them in my Gulp task. All modules have .(s)css and .js files I need to include. I see two options:

  1. copy the files over from the node_modules folder to my own vendor folders for both js and stylesheets
  2. import them dynamically in my Gulp tasks from the node_modules folder. This way I don't have to copy them over each time.

In my opinion #2 is the smartest, although Im not sure it's the best. I would like to get some insight on this from some more experienced Gulp developers. I'm not getting #2 to work (only partially) so was wondering if I should stop at all and go to #1, or continue.

Thanks guys!

Huston Hedinger How would a pro like you do this?