title: How to change the ts path aliases for an nx application
body: <p>I am importing an existing application into an NX monorepo with a file structure a little different from default apps. It looks like this:</p>
  <pre><code>apps
    my-app
      src
        feature-1
        feature-2
        main
          components
            my-component.tsx
          index.tsx
      tsconfig.json
  </code></pre>
  <p>Due to this layout of everything being inside src/main, I want all my absolute imports to start from src/main.</p>
  <pre><code>// src/main/index.tsx
  import MyComponent from 'components/my-component'
  </code></pre>
  <p>Which should resolve to <code>src/main/components/my-component</code>. Obviously I could absolute import this specific example, but the actual one is a huge application and this isnt a feasible solution.</p>
  <p>In this original single app repository, we achieved this by setting <code>paths</code> inside <code>tsconfig</code></p>
  <pre><code>// tsconfig.json
  {
    &quot;compilerOptions&quot;: {
       ...     
       &quot;paths&quot;: {
         &quot;*&quot;: [&quot;src/main/*&quot;, &quot;node_modules/*&quot;]
       }
    }
  }
  </code></pre>
  <p>However, as NX's root tsconfig uses paths to map to libraries, this is no longer a valid solution. How can I tell NX to resolve my imports from <code>src/main</code> instead of <code>src</code>?</p>
  <p>I have tried setting <code>resolve.modules</code> to <code>path.resolve(__dirname, 'src/main')</code> in my webpack config, but it didn't seem to work. I have also tried setting <code>baseUrl</code> in the app's tsconfig but that then removes my ability to import libraries.</p>