# Using Netlify Dev CLI with unbundled functions and a static site

**URL:** <https://answers.netlify.com/t/using-netlify-dev-cli-with-unbundled-functions-and-a-static-site/4251>\
**Category:** Support\
**Tags:** netlify-dev-open-beta, lambda-functions, netlify-newbie\
**Created:** [October 16, 2019, 5:11pm UTC](https://answers.netlify.com/t/using-netlify-dev-cli-with-unbundled-functions-and-a-static-site/4251 "2019-10-16T17:11:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbeseda](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/tbeseda/32/1037_2.png) [@tbeseda](https://answers.netlify.com/u/tbeseda)\
**Post date:** [October 16, 2019, 5:11pm UTC](https://answers.netlify.com/t/using-netlify-dev-cli-with-unbundled-functions-and-a-static-site/4251/1 "2019-10-16T17:11:52Z")

</div>

I may be conflating a few different features/docs, but I’d like to use something like this directory structure to dev locally and have Netlify deploy on github hooks:

```auto
|- functions/
    |- foo/
        |- node_modules/
        |- index.js
        |- package.json
    |- bar/
        |- node_modules/
        |- index.js
        |- package.json
|- publish/
    |- index.html

```

Essentially, I’d like to call both `foo` and `bar` functions from `index.html` while I work locally on my machine on all three. Bonus: Netlify would build and deploy as I have it now working from `master` branch and Github pull requests.

Maybe I’m asking for too much magic here 😄 but is this possible?  
Thanks!

---

<div class="post-metadata">

**Author:** ![luke](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/luke/32/39_2.png) [@luke](https://answers.netlify.com/u/luke)\
**Post date:** [October 17, 2019, 7:08am UTC](https://answers.netlify.com/t/using-netlify-dev-cli-with-unbundled-functions-and-a-static-site/4251/2 "2019-10-17T07:08:21Z")

</div>

@tbeseda, if you configure a functions directory, this should “just work”:

> **[Functions overview](https://docs.netlify.com/functions/overview/)**
>
> Use serverless functions to run on-demand, server-side code without having to run a dedicated server. Learn about default and custom deployment options.

This is done with the magic (okay, not really) [zip-it-and-ship-it](https://github.com/netlify/zip-it-and-ship-it) functionality in our build image.

Quoting that repo’s README below ([the CLI section](https://github.com/netlify/zip-it-and-ship-it#cli)):

> A minimal CLI version of `zip-it-and-ship-it` is provided for use inside the [build-image](https://github.com/netlify/build-image), although this is automatically invoked on users behalf during builds and you typically do not need to run this yourself.

Have you configured a functions directory in netlify.toml or the UI?

---

<div class="post-metadata">

**Author:** ![tbeseda](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/tbeseda/32/1037_2.png) [@tbeseda](https://answers.netlify.com/u/tbeseda)\
**Post date:** [November 1, 2019, 2:21pm UTC](https://answers.netlify.com/t/using-netlify-dev-cli-with-unbundled-functions-and-a-static-site/4251/3 "2019-11-01T14:21:59Z")

</div>

Ended up being super simple. Just needed to make sure the `.js` file in my function subdirectory had the same file name as its parent folder: `functions/foo/foo.js`, `functions/bar/bar.js`, etc.

It [mentions this in the docs](https://docs.netlify.com/functions/build-with-javascript/#javascript-file-location-options) but I overlooked it.
