title: Typescript import index.ts is not a module
body: <p>I am trying to import index.ts in a subfolder which has other imports. But I keep getting a typescript error.</p>
  
  <p>full repo: <a href="https://github.com/Shavindra/webpack-react-sw" rel="nofollow noreferrer">https://github.com/Shavindra/webpack-react-sw</a></p>
  
  <p><code>(5,32): error TS2306: File 'C:/../src/reducers/index.ts' is not a module.</code></p>
  
  <p>I am not quite sure what I am doing wrong here. I am using TS 2.4.1. I've tried restarting the computer/VSCode but nothing seems to work :-|</p>
  
  <pre><code>// ./src/reducers/counter.reducer.ts    
  export const counterReducer = (state = 0, action) =&gt; {
    switch (action.type) {
      case 'INCREMENT':
        return state + 1;
      case 'DECREMENT':
        return state - 1;
      default:
        return state;
    }
  };
  
  
  // ./src/reducers/index.ts
  export * from './counter.reducer';
  
  
  // ./src/app.ts
  import * as React from 'react';
  import * as React from 'react';
  import * as ReactDOM from 'react-dom';
  import { createStore } from 'redux';
  import { Counter } from './components/counter/counter.component';
  import { counterReducer } from './reducers';
  
  
  const store = createStore(counterReducer);
  const rootEl = document.getElementById('root');
  
  const render = () =&gt; ReactDOM.render(
      &lt;Counter
          value={store.getState()}
          onIncrement={() =&gt; store.dispatch({ type: 'INCREMENT' })}
          onDecrement={() =&gt; store.dispatch({ type: 'DECREMENT' })}
      /&gt;,
      rootEl
  );
  
  render();
  store.subscribe(render);
  
  // tsconfig.json
  
  {
    "compilerOptions": {
      "module": "commonjs",
      "target": "es5",
      "sourceMap": true,
      "jsx":"react",
      "lib": [
        "webworker",
        "es6",
        "scripthost",
        "dom"
      ]
    },
    "files": [ "node_modules/@types/react-dom/index.d.ts", "node_modules/@types/react/index.d.ts", "typings/file-loader.d.ts"  ],
    "exclude": [
      "typings/browser.d.ts",
      "typings/browser",
      "node_modules"
    ]
  }
  </code></pre>