title: Typescript emitted no output for '/path/to/file.ts'
body: <p>I have a library written with typescript. I can transpile it using <code>tsc</code> and with the configuration below without any problems.</p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "es6",
      "module": "commonjs",
      "lib": [
        "es6",
        "es5",
        "dom",
        "es2017"
      ],
      "declaration": true,
      "declarationMap": true,
      "sourceMap": true,
      "outDir": "./dist",
      "strict": true,
      "esModuleInterop": true,
      "experimentalDecorators": true,
      "emitDecoratorMetadata": true,
      "listEmittedFiles": true
    },
    "exclude": [
      "./dist",
      "./test",
      "./bin"
    ],
    "include": [
      "./lib"
    ]
  }
  </code></pre>
  
  <p>But when another project tries to use this library from a linked npm package, it fails to transpile and bundle using <code>webpack</code> and <code>ts-loader</code>. For all the files of the library webpack gets error: </p>
  
  <blockquote>
    <p>Error: Typescript emitted no output for /library/path/to/file.ts</p>
  </blockquote>
  
  <p>Note: <em>webpack tries to load it from the linked destination not from <code>node_modules</code> as it is linked with npm</em>.</p>
  
  <hr>
  
  <p>Webpack configuration of the project uses library is below.</p>
  
  <pre><code>module.exports = (entry, dist) =&gt; Object.assign({
    entry,
    mode: "production",
    output: {
      filename: "index.js",
      path: dist,
    },
    resolve: {
      extensions: [".js", ".ts"]
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          use: 'ts-loader',
          exclude: /node_modules/
        }
      ]
    },
    stats: 'verbose'
  });
  </code></pre>
  
  <p>tsconfig.json of the project uses library</p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "es6",
      "module": "commonjs",
      "lib": [
        "es6",
        "es5",
        "dom",
        "es2017"
      ],
      "declaration": true,
      "declarationMap": true,
      "sourceMap": true,
      "outDir": "./dist",
      "strict": true,
      "esModuleInterop": true,
      "allowSyntheticDefaultImports": true,
      "experimentalDecorators": true,
      "emitDecoratorMetadata": true
    },
    "exclude": [
      "./dist"
    ],
    "include": [
      "./index.ts"
    ]
  }
  </code></pre>
  
  <p>And an example of library file that is not emitting output:</p>
  
  <pre><code>import {Ctor, Injector} from "./injector";
  import {ERROR_CODES, PuzzleError} from "./errors";
  import {Route} from "./server";
  
  
  export interface ApiEvents {}
  
  export interface ApiConfig {
    route: Route;
    subApis?: Array&lt;Ctor&lt;Api&gt;&gt;;
  }
  
  interface ApiBase {
  }
  
  export function PuzzleApi&lt;T&gt;(config: ApiConfig) {
    return Injector.decorate((constructor: () =&gt; void) =&gt; {
      console.log(`Registering Api: ${constructor.name}`);
  
    }, config);
  }
  
  export class Api implements ApiBase {
    config: ApiConfig;
  
    constructor() {
      const config = (this.constructor as any).config as ApiConfig;
  
      if (!config) {
        throw new PuzzleError(ERROR_CODES.CLASS_IS_NOT_DECORATED, this.constructor.name);
      } else {
        this.config = config;
      }
    }
  }
  </code></pre>
  
  <p>I couldn't find any reason why it is not emitting output for that project. I can transpile the library without any problems. Can someone help me about this?</p>