title: require.extensions is not supported by webpack. Use a loader instead
body: <p>I use <code>express</code> + <code>webpack3</code> + <code>ejs</code> + <code>typescript</code></p>
  
  <p>when I build, the <code>stdout</code> output give me some warning: </p>
  
  <pre><code>WARNING in ./node_modules/ejs/lib/ejs.js
  require.extensions is not supported by webpack. Use a loader instead.
   @ ./src/environment.ts 4:10-24
   @ ./src/server.ts
  
  WARNING in ./node_modules/ejs/lib/ejs.js
  require.extensions is not supported by webpack. Use a loader instead.
   @ ./src/environment.ts 4:10-24
   @ ./src/server.ts
  
  WARNING in ./node_modules/express/lib/view.js
  80:29-41 Critical dependency: the request of a dependency is an expression
  </code></pre>
  
  <p>here is part of <code>webpack.config.ts</code>: </p>
  
  <pre><code>import * as webpack from 'webpack';
  import * as path from 'path';
  import * as CopyWebpackPlugin from 'copy-webpack-plugin';
  
  const config: webpack.Configuration = {
    target: 'node',
    devtool: 'source-map',
    entry: {
      server: path.resolve(__dirname, './src/server.ts')
    },
    output: {
      path: path.resolve(__dirname, 'build'),
      filename: 'server.js'
    },
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          exclude: /node_modules/,
          loader: 'ts-loader'
        }
      ]
    },
    resolve: {
      extensions: ['.ts', '.tsx', '.js']
    },
    plugins: [
      new CopyWebpackPlugin([
        { from: './src/views', to: 'views' },
        { from: './src/public', to: 'public' }
      ])
    ]
  };
  
  export default config;
  </code></pre>
  
  <p>and part of <code>tsconfig.json</code>: </p>
  
  <pre><code>"include": [
      "src/server.ts",
      "src/typings"
    ],
    "exclude": [
      "node_modules",
      "src/public",
      "src/views"
    ]
  </code></pre>