title: Resolving ES6 import path with fallback in Webpack 2
body: <p>My folders' structure is as follows:</p>
  
  <pre><code>- test
    - scripts
        index.js
        user.js
  - default
    - scripts
        index.js
        api.js
        user.js
  </code></pre>
  
  <p>I need to resolve an import path locally ("test" directory), while the fallback in case of failure should be resolved through the "default" directory.</p>
  
  <p>The code in test/scripts/index.js is:</p>
  
  <pre><code>import api from 'scripts/api'; // should be taken from 'default'
  import user from 'scripts/user; // should take the local 'user.js'
  ...
  </code></pre>
  
  <p>I'm using Webpack 2.1.0 with the following configuration:</p>
  
  <pre><code>...
  resolve: {
      modules: [
          path.resolve( './default' )
      ]
  }
  ...
  </code></pre>
  
  <p>This configuration makes webpack to resolve all the module <code>'script/*'</code> paths through 'default', while relative <code>'./script/*'</code> paths never gets out of the module's directory, so no relative path can be used as a fallback.</p>
  
  <p>It seems like <code>resolve.fallback</code> is not supported by Webpack 2</p>
  
  <p>I've tried to write a plugin to <code>normal-module-factory-&gt;before-resolve</code>, but the only paths I receive are the entry paths.</p>
  
  <p>Is there any possible configuration to solve that?
  Is writing a custom loader could be the solution?</p>
  
  <p>Thanks</p>