title: Replacing/aliasing a file using Webpack
body: <p>I am trying to use a very new third-party module in my project, which I installed using <code>npm</code>. The module was apparently developed on an OS with a case-insensitive file system, so it requires a file <code>injectable.js</code> whereas the actual file name is <code>Injectable.js</code>. This breaks the bundling process.</p>
  
  <p>The developers of the module know of this issue. Meanwhile, I am trying to figure out how to use the module as it is. I am using Webpack for bundling my project.</p>
  
  <p>The tree structure of the relevant part of my project is roughly this:</p>
  
  <pre><code>├──config
  │     ├──webpack
  │          ├──webpack.js
  │
  ├──src
  │   ├──client
  │        ├──index.js
  │
  │
  ├──node_modules
  │    ├──the module in question
  │          ├── dist
  │          │   ├── decorators
  │          │   │   ├── providers
  │          │   │         ├── Injectable.js
  │          │   │
  │          │   ├── index.js
  |
  ├──gulpfile.js
  </code></pre>
  
  <p>The <code>index.js</code> file in the <code>node_modules/the module in question/dist</code> folder is requiring the file <code>Injectable.js</code> from the providers folder, but does so with the command <code>require('./decorators/providers/injectable');</code></p>
  
  <p>I would like to alias <code>./decorators/providers/injectable</code> in that <code>index.js</code> with <code>./decorators/providers/Injectable</code>.</p>
  
  <p>Here is what I am doing in my webpack.js file:</p>
  
  <pre><code>resolve: {
          alias: {
              './decorators/providers/injectable': './decorators/providers/Injectable.js',
          },
  }
  </code></pre>
  
  <p>But this still does not work; I am getting the error <code>Module not found: Error: Cannot resolve 'file' or 'directory' ./decorators/providers/injectable</code></p>
  
  <p>Could you please suggest how to replace one file name in a node module with another while bundling with Webpack?</p>
  
  <p>UPDATE:</p>
  
  <p>Here's webpack's config file:</p>
  
  <pre><code>var path = require('path');
  var rucksack = require('rucksack-css')({
      fallbacks: true,
      autoprefixer: true
  });
  var precss = require('precss');
  var csswring = require('csswring');
  var webpack = require('webpack');
  
  module.exports = {
      context: path.join(__dirname, '../../'),
      debug: false,
      entry: [
          './src/client/'
      ],
      output: {
          path: path.join(__dirname, '../../public/assets/js'),
          filename: 'bundle.js'
      },
      module: {
          loaders: [
              {
                  test: /\.js$/,
                  exclude: /node_modules/,
                  loader: 'babel?stage=1'
              },
              {
                  test: /\.css$/,
                  loader: 'style-loader!css-loader!postcss-loader'
              },
              {test: /\.png$/, loader: 'file-loader'},
              {test: /\.gif$/, loader: 'file-loader'},
              {test: /\.jpe?g$/, loader: 'file-loader'},
              {test: /\.eot$/, loader: 'file-loader'},
              {test: /\.woff2?$/, loader: 'file-loader'},
              {test: /\.ttf$/, loader: 'file-loader'},
              {test: /\.svg$/, loader: 'file-loader'}
          ]
      },
      postcss: function () {
          return [rucksack, precss, csswring];
      },
      plugins: [
          new webpack.NormalModuleReplacementPlugin(
              /ng-forward\/dist\/decorators\/providers\/injectable\.js/,
              require.resolve('ng-forward/dist/decorators/providers/Injectable')
          )
      ],
      resolve: {
          extensions: ['', '.js']
      }
  };
  </code></pre>