# Using gulp with serverless

**URL:** <https://forum.serverless.com/t/using-gulp-with-serverless/1100>\
**Category:** Serverless Framework\
**Created:** [January 11, 2017, 4:21am UTC](https://forum.serverless.com/t/using-gulp-with-serverless/1100 "2017-01-11T04:21:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hackman](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/hackman/32/1727_2.png) [@hackman](https://forum.serverless.com/u/hackman)\
**Post date:** [January 11, 2017, 4:21am UTC](https://forum.serverless.com/t/using-gulp-with-serverless/1100/1 "2017-01-11T04:21:44Z")

</div>

Has anyone created a project to prepare their project to a build folder before serverless packages the service for deployment?

I see that serverless seems to package every module in node\_modules, even if they are saved for development purposes only. As I am creating my servicing using some npm modules for development purposes, seems like a waste to package them up when they aren’t needed.

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [January 11, 2017, 4:34am UTC](https://forum.serverless.com/t/using-gulp-with-serverless/1100/2 "2017-01-11T04:34:51Z")

</div>

The problem is it’s hard for Serverless to know which modules are used for your application, and which are only used for development - NPM v3 tries to store them as flat as possible, so it’s not simple.

I have gotten around this by installing my function dependencies in subdirectories, and then packaging up the them. I put my development dependencies in the top level of my service, and ignore it for packaging purposes.

The only issue is that I have to have a `package.json` in each function directory, but I actually like this as it makes dependencies explicit per function.

---

<div class="post-metadata">

**Author:** ![hackman](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/hackman/32/1727_2.png) [@hackman](https://forum.serverless.com/u/hackman)\
**Post date:** [January 11, 2017, 2:49pm UTC](https://forum.serverless.com/t/using-gulp-with-serverless/1100/3 "2017-01-11T14:49:28Z")

</div>

I thought of doing something similar where I would have build folders for local development/testing vs build/deploy folders. The only problem with that is keeping the dependencies in sync between the two folders to ensure I don’t miss anything. Unit Testing should hopefully find anything missing but that is assuming tests have 100% code coverage - that would be Utopia.

---

<div class="post-metadata">

**Author:** ![bni](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/bni/32/1329_2.png) [@bni](https://forum.serverless.com/u/bni)\
**Post date:** [January 11, 2017, 8:41pm UTC](https://forum.serverless.com/t/using-gulp-with-serverless/1100/4 "2017-01-11T20:41:35Z")

</div>

I maintain excludes in serverless.yml for all dev dependencies and everything else don’t need in runtime, like the .git folder
