Search code examples
javascriptjquerycompass-sassgulp

Combining js files


I recently started to use Gulp.js along with Sass and Compass. I originally started my project outside this environment using an antiquated index.html with css and js folder. All my JS files were being loaded separately. (e.i. jQuery, iLightbox, etc.)

Now that my JS files are being combined to one file, I and getting several errors. What should I be looking out for? Keep in mind, I'm not the greatest javascript/jQuery of all time. One of the training videos I saw on Lynda.com said to add an anonymous variable around the files content. I tried a little bit of that too, but no luck.

Here are my project files (GitHub)


Solution

  • It looks like you don't have jQuery itself in your javascripts directory, or your jsSources in gulpfile.js. If you're not including it on your site, before loading the output of the gulpfile, you'll get the errors you're seeing.

    Just add jQuery to jsSources (probably first in the list?) and it should work.