title: How to debug with vs-code and ts-node in a typescript monorepo without compile typescript
body: <p>I init a monorepo with lerna.</p>
  <p>The monorepo has 2 packages: <code>@mono/util1</code>, <code>@mono/util2</code>. And <code>util1</code> and <code>util2</code> are linked to root node_modules as I wish:</p>
  <p><a href="https://i.stack.imgur.com/9vnL9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9vnL9.png" alt="enter image description here" /></a></p>
  <p>util2 depends on util1</p>
  <p><a href="https://i.stack.imgur.com/mV81J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mV81J.png" alt="enter image description here" /></a></p>
  <p>The 2 packages both have a <code>src</code> dir and a <code>dist</code> dir. Before I run tsc, the dist dirs are both empty.</p>
  <p>The 2 packages both have <code>&quot;main&quot;: &quot;dist/index.js&quot;</code> in their <code>package.json</code>.</p>
  <p>Here comes the problem: when I run <code>node -r ts-node/register packages/util2/src/index.ts</code> with vs-code debugger, it throws an error: <code>Error: Cannot find module '@mono/util1'</code></p>
  <p>This is because in root <code>node_modules/@mono/util1/package.json</code>, its main filed is <code>dist/index.js</code>. Now I want when util2 import util1, it can resolve to <code>node_modules/@mono/util1/src/index.ts</code>not to <code>node_modules/@mono/util1/dist/index.js</code>. What should I do?</p>