# Using Lerna and Yarn Workspaces with Serverless

**URL:** <https://discourse.sst.dev/t/using-lerna-and-yarn-workspaces-with-serverless/1958>\
**Category:** Chapter Comments\
**Created:** [July 9, 2020, 9:46pm UTC](https://discourse.sst.dev/t/using-lerna-and-yarn-workspaces-with-serverless/1958 "2020-07-09T21:46:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [July 9, 2020, 9:46pm UTC](https://discourse.sst.dev/t/using-lerna-and-yarn-workspaces-with-serverless/1958/1 "2020-07-09T21:46:34Z")

</div>

Link to chapter — [https://serverless-stack.com/chapters/using-lerna-and-yarn-workspaces-with-serverless.html](https://serverless-stack.com/chapters/using-lerna-and-yarn-workspaces-with-serverless.html)

---

<div class="post-metadata">

**Author:** ![AaronOverton](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/aaronoverton/32/315_2.png) [@AaronOverton](https://discourse.sst.dev/u/AaronOverton)\
**Post date:** [August 16, 2020, 9:06pm UTC](https://discourse.sst.dev/t/using-lerna-and-yarn-workspaces-with-serverless/1958/2 "2020-08-16T21:06:30Z")

</div>

I used this and managed to get through all of it working today. Super good, hit only one snag:

The individual services are using serverless-bundle. The documentation there shows support for aliases via custom:bundle:aliases in serverless.yml.

Adding that section in the serverless.yml for a service, I couldn’t come up with any combination that seems to properly resolve the alias. I’m pretty sure the aliasing is a pretty new feature of serverless-bundle, does it not yet work in the Lerna/Yarn starter? If it does, and /libs and /services are peer folders, what would you need in the aliases section to get it to work in this kind of monorepo?

I don’t know whether this is further complicated because I was trying it using serverless-offline and didn’t try it in an actual deploy, but I don’t think that should matter.

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [August 24, 2020, 12:59am UTC](https://discourse.sst.dev/t/using-lerna-and-yarn-workspaces-with-serverless/1958/3 "2020-08-24T00:59:45Z")

</div>

Thanks!

Yeah it shouldn’t matter. Can you open an issue over on GitHub (if you haven’t already)?

> **[AnomalyInnovations/serverless-bundle](https://github.com/AnomalyInnovations/serverless-bundle/issues)**
>
> Optimized packages for ES6 and TypeScript Node.js Lambda functions without any configuration. - AnomalyInnovations/serverless-bundle

---

<div class="post-metadata">

**Author:** ![AaronOverton](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/aaronoverton/32/315_2.png) [@AaronOverton](https://discourse.sst.dev/u/AaronOverton)\
**Post date:** [August 24, 2020, 3:22pm UTC](https://discourse.sst.dev/t/using-lerna-and-yarn-workspaces-with-serverless/1958/4 "2020-08-24T15:22:58Z")

</div>

I dug into the code and seem to have figured it out. You need to give the alias a relative path starting from the location of the serverless.yml file, such as:

```
bundle:
    aliases:
          - "Libs": ../../libs

```

That ended up working for me.

---

<div class="post-metadata">

**Author:** ![RyanHow](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/ryanhow/32/1124_2.png) [@RyanHow](https://discourse.sst.dev/u/RyanHow)\
**Post date:** [February 8, 2021, 2:12pm UTC](https://discourse.sst.dev/t/using-lerna-and-yarn-workspaces-with-serverless/1958/5 "2021-02-08T14:12:18Z")

</div>

Is there a way to ignore changes to some files when determining what to deploy?

For instance if a README.md is updated, this would trigger a redeployment of everything.

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [May 15, 2021, 10:44pm UTC](https://discourse.sst.dev/t/using-lerna-and-yarn-workspaces-with-serverless/1958/6 "2021-05-15T22:44:43Z")

</div>

Hmm Lerna shouldn’t pick those up? Is that what you are using?
