title: Deploying firebase functions with local depencies using firebase CLI
body: <h3>Setup</h3>
  <p>I have a monorepo setup with the following file structure:</p>
  <pre><code>├── functions
  │   ├── src
  │   └── package.json
  ├── shared
  |   ├── dist
  |   ├── src
  |   └── package.json
  ├── frontend
  |    └── ...
  └── firebase.json
  </code></pre>
  <h3>Approach 1 (failed)</h3>
  <p><code>./shared</code> is holding TypeScript classes shared among the <code>./backend</code> and <code>./frontend</code>. Ideally, I want to reference the shared lib from the <code>functions/package.json</code> using a symlink to avoid that I have to re-install after every change to my shared code (where most of the functionality resides).</p>
  <p>However, this does not work (neither using <code>link:</code>, nor an absolute <code>file:</code> path, nor an relative <code>file:</code> path)</p>
  <pre><code>// functions/package.json
    ...
    &quot;dependencies&quot;: {
      &quot;shared&quot;: &quot;file:/home/boern/Desktop/wd/monorepo/shared&quot;
      ...
    }
  </code></pre>
  <p>resulting into an error upon <code>firebase deploy --only functions</code> (<code>error Package &quot;shared&quot; refers to a non-existing file '&quot;home/boern/Desktop/wd/monorepo/shared&quot;'</code>). The library (despite being present in <code>./functions/node_modules/</code>) was not transferred to the server?</p>
  <h3>Approach 2 (failed)</h3>
  <p>Also, setting <code>&quot;functions&quot;: {&quot;ignore&quot;: []}</code> in firebase.json did not help.</p>
  <h3>Approach 4 (works, but lacks requirement a) see Goal)</h3>
  <p>The only thing that <strong>DID</strong> work, was a proposal by <a href="https://github.com/firebase/firebase-tools/issues/968#issuecomment-460323113" rel="nofollow noreferrer">adevine on Github</a>:</p>
  <pre><code>// functions/package.json
    ...
    &quot;scripts&quot;: {
       ...
      &quot;preinstall&quot;: &quot;if [ -d ../shared ]; then npm pack ../shared; fi&quot;
    },
    &quot;dependencies&quot;: {
      &quot;shared&quot;: &quot;file:./bbshared-1.0.0.tgz&quot;
      ...
    }
  </code></pre>
  <h3>Goal</h3>
  <p>Can someone point out a way to reference a local library in a way that a) <code>./functions</code> always uses an up-to-date version during development and b) deployment using the stock Firebase CLI succeeds (and not, e.g. using <a href="https://github.com/rxdi/firelink" rel="nofollow noreferrer">firelink</a>)? Or is this simply not <a href="https://github.com/firebase/firebase-tools/issues/653" rel="nofollow noreferrer">supported yet</a>?</p>