zurb/foundation-apps-template — pull request #8 by gakimball (2014-12-10 07:09:05+00:00)
Title: Gulpfile refactor

This reworking of the template's `gulpfile.js` tries to streamline things, and also switch around how files are imported based on some internal discussions.

Here are the changes:
- The `copy-partials` task was merged into the regular `copy` task, and removed the corresponding watcher. A separate task isn't needed for the template repo, because those files will never change.
- This also makes the `clean-partials` task unnecessary, so it was removed as well.
- The two tasks for processing JavaScript were combined into one task.
- All framework code and dependencies are now compiled into one `foundation.js` file. The user's project-specific code is compiled to `app.js`. This mimics the model we use in Foundation 5. Also, if we eventually transfer this method of compiling back to the main repo, it sets us up to eventually host the Apps JS on a CDN, in which case we'd want everything you need in one file.
- I also temporarily removed two libraries I don't think we're using: jQuery and notify.js. At least, I don't *think* we're using jQuery, or I assumed we weren't, and it was still being compiled in by accident.
- Moved the big arrays of directories—for compiling Sass and JavaScript—to the top of the file so they're easer to find and change.
- Added a bunch of comments better explaining what each task does.

This pares down the build process to four essential tasks: copying files, compiling Sass, compiling JS, and copying pages/processing routes. Hopefully this will make the file easier to understand.

***Unfortunately***, I must not have the import order for the JavaScript right, because I get this error on startup:

```
Uncaught Error: [$injector:unpr] Unknown provider: $$jqLiteProvider <- $$jqLite <- $animate <- $compile
```

I tried imitating the order the files are processed in the current Gulpfile, but it still doesn't seem to work. @AntJanus, I'll need your help making it go :)