title: Changing dist directory in Nestjs
body: <p>I'm building an API based on Nestjs. The <code>main.ts</code> file is nested in a subfolder of my <code>src</code> directory. As a result, the compiled files are also nested in the <code>dist</code> directory and my entry point is <code>dist/api/main.js</code> instead of <code>dist/main.js</code>. I would like to keep things that way.</p>
  
  <p>When starting my app with <code>npm run start:dev</code>, I get the following error:</p>
  
  <pre><code>4:47:32 PM - Found 0 errors. Watching for file changes.
  internal/modules/cjs/loader.js:969
      throw err;
      ^
  
  Error: Cannot find module '/home/ymonb/Nest.js/myProject/dist/main'
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:17)
      at Function.Module._load (internal/modules/cjs/loader.js:859:27)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
      at internal/main/run_main_module.js:17:47 {
    code: 'MODULE_NOT_FOUND',
    requireStack: []
  }
  </code></pre>
  
  <p>I need to be able to reconfigure Nest with the new path. I looked into <a href="https://docs.nestjs.com/cli/usages#nest-start" rel="noreferrer">the documentation</a>, but I don't see anything to specify a different entry point.</p>
  
  <p>I think that maybe I need to edit <code>nest-cli.json</code>, but I can't find any documentation about the possible options in this file (if you know of such documentation, i'm interested!).</p>
  
  <p>This is my <code>nest-cli.json</code>:</p>
  
  <pre><code>{
    "collection": "@nestjs/schematics",
    "sourceRoot": "src/api"
  }
  </code></pre>
  
  <p>Any idea?</p>