title: Importing module from js file in Webpack 2
body: <p>I am trying to use the following syntax in Webpack 2:</p>
  
  <pre><code>import someSvc = require("./some.svc.js");
  </code></pre>
  
  <p>But I am getting the error:</p>
  
  <pre><code>error TS2307: Cannot find module './some.svc.js'.
  </code></pre>
  
  <p>What am I doing wrong?! How do I import my js module in Webpack 2?</p>
  
  <p>For the sake of thoroughness, I boiled my project down to the tiniest possible example, and will provide the files below:</p>
  
  <h1>webpack.config.js</h1>
  
  <pre><code>var path = require('path');
  
  module.exports = function makeWebpackConfig() {
    var config = {};
    config.entry = { 'app': './src/main.ts' };
    config.output = {
      path: root('dist'),
      filename: 'js/[name].js'
    };
    config.module = {
      rules: [
        {
          test: /\.ts$/,
          loaders: ['ts-loader']
        }
      ]
    };
    return config;
  }();
  
  // Helper functions
  function root(args) {
    args = Array.prototype.slice.call(arguments, 0);
    return path.join.apply(path, [__dirname].concat(args));
  }
  </code></pre>
  
  <h1>package.json</h1>
  
  <pre><code>{
    "name": "webpack",
    "version": "1.0.0",
    "description": "",
    "main": "src/main.ts",
    "dependencies": {},
    "devDependencies": {
      "ts-loader": "^0.9.5",
      "typescript": "^2.0.3"
    },
    "scripts": {},
    "author": "",
    "license": "ISC"
  }
  </code></pre>
  
  <h1>tsconfig.js</h1>
  
  <pre><code>{
    "compilerOptions": {
      "target": "ES5",
      "module": "commonjs",
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "sourceMap": true,
      "noEmitHelpers": true
    },
    "compileOnSave": false,
    "buildOnSave": false,
    "exclude": [
      "node_modules"
    ]
  }
  </code></pre>
  
  <h1>src/main.ts</h1>
  
  <pre><code>import someSvc = require("./some.svc.js");
  </code></pre>
  
  <h1>src/some.svc.js</h1>
  
  <pre><code>if (typeof module !== 'undefined' &amp;&amp; module.exports) {
      module.exports.config = function (conf) {
          return { abc: 123 };
      };
  }
  </code></pre>
  
  <p>Stick these files together, run <code>webpack</code> and you should see the same error.</p>
  
  <p>Am I missing something simple to get this working?</p>