title: How to copy package.json in dist or build folder when running tsc (TypeScript compiler)
body: <p>I have a TypeScript React component that uses a <code>package.json</code> file (see screenshot) and I run <code>tsc</code> in order to transpile it to es5 in my <code>dist</code> folder but the <code>package.json</code> file doesn't get copied. Please note that in the screenshot I manually copied it in the <code>dist</code> folder.</p>
  
  <p><a href="https://i.stack.imgur.com/4pgTm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4pgTm.png" alt="component screenshot"></a></p>
  
  <p>So my question: Is there a way to do this via <code>tsc/tsconfig</code> ... without having to add a copy script (ran via <code>yarn build</code>). Because I would like this to be updated also when running <code>tsc --watch</code></p>
  
  <p>Also I do NOT wish to rename my Component.tsx to index.tsx in the component folders. I don't want to have 200 index.tsx files in my project and using the <code>package.json</code>'s <code>main</code> allow me to have <code>import SomeComponent from './components/SomeComponent'</code> instead of doing <code>import SomeComponent from './components/SomeComponent/SomeComponent'</code> so it's great.</p>
  
  <p>Here is my <code>tsconfig</code> file:</p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "es5",
      "lib": ["dom", "dom.iterable", "esnext"],
      "skipLibCheck": true,
      "esModuleInterop": true,
      "allowSyntheticDefaultImports": true,
      "strict": true,
      "forceConsistentCasingInFileNames": true,
      "module": "commonjs",
      "outDir": "dist",
      "moduleResolution": "node",
      "resolveJsonModule": true,
      "experimentalDecorators": true,
      "strictPropertyInitialization": false,
      "declaration": true,
      "jsx": "react"
    },
    "include": ["src"]
  }
  </code></pre>
  
  <p>Many thanks for your time and your help or suggestions.</p>