title: How to bundle local typescript files into main bundle using Rollup
body: <p>I am trying to create an npm module that can be used in the browser.</p>
  <p>I'm using typescript and rollup.</p>
  <p>My <code>tsconfig.json</code> is:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;compilerOptions&quot;: {
      &quot;module&quot;: &quot;CommonJS&quot;,
      &quot;outDir&quot;: &quot;lib&quot;,
      &quot;strict&quot;: true,
      &quot;rootDir&quot;: &quot;src&quot;
    }
  }
  </code></pre>
  <p>and my <code>rollup.config.js</code> is:</p>
  <pre class="lang-js prettyprint-override"><code>import typescript from &quot;@rollup/plugin-typescript&quot;;
  
  export default {
    input: &quot;src/index.ts&quot;,
    output: {
      dir: &quot;lib&quot;,
      format: &quot;iife&quot;,
    },
    plugins: [typescript()],
  };
  </code></pre>
  <p>Inside <code>src/index.ts</code> I have the following:</p>
  <pre class="lang-js prettyprint-override"><code>// src/index.ts
  import log from './log'
  
  const myFn = () =&gt; {
   ...myFn code
  }
  </code></pre>
  <p>My issue is that in the bundle, I get the following:</p>
  <pre><code>// lib/index.js bundle
  var log_1 = require(&quot;./log&quot;);
  </code></pre>
  <p>When I actually want to bundle the <code>log</code> file inside the main <code>lib/index.js</code>.</p>
  <p>How can I do this with Typescript and rollup?</p>
  <p>Note: I have tried to add <code>outFile</code> (<a href="https://www.typescriptlang.org/tsconfig#outFile" rel="nofollow noreferrer">ts docs</a>) but that is not supported by &quot;@rollup/plugin-typescript&quot;.</p>
  <p>Do I have to do the tsc compile myself and then the rollup bundle?</p>