title: Webpack Cannot Resolve node_modules lazy assets
body: <p>I'm working on a vuejs project and we're trying to use external vue cli applications as libraries. In these libraries we want to be able to export a router config, which lazy loads the components within one of these modules. However when we compile this using the vue-cli-service into a library and it's got lazy chunk assets we cannot resolve them with webpack.</p>
  
  <p>I have a feeling its something to do with the public path, or some simple configuration but i'm just stuck and banging my head against a wall at this stage with it. </p>
  
  <p><a href="https://github.com/EvanBurbidge/mono-repo-tester" rel="noreferrer">https://github.com/EvanBurbidge/mono-repo-tester</a></p>
  
  <p>Here's a simple overview of what we're doing</p>
  
  <pre><code>App1 -&gt; main app, installs App2, imports { router } from 'app2'
  App2 -&gt; library, compiles to common js lib exports router config
  </code></pre>
  
  <p>The console output from app1 
  <a href="https://i.stack.imgur.com/lDwMN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lDwMN.png" alt="see_screenshot_1"></a>
  The router configuration from app2
  <a href="https://i.stack.imgur.com/z9svk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/z9svk.png" alt="see_screenshot_2"></a>
  The router importing app2 from app1
  <a href="https://i.stack.imgur.com/hdf75.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hdf75.png" alt="see_screenshot_3"></a></p>
  
  <blockquote>
    <p><code>/* config.module.rule('js') */
          {
            test: /\.jsx?$/,
            exclude: [
              function () { /* omitted long function */ }
            ],
            use: [
              /* config.module.rule('js').use('cache-loader') */
              {
                loader: 'cache-loader',
                options: {
                  cacheDirectory: '/Users/evan/test/node_modules/.cache/babel-loader',
                  cacheIdentifier: '39e7e586'
                }
              },
              /* config.module.rule('js').use('babel-loader') */
              {
                loader: 'babel-loader'
              }
            ]
          },
    </code></p>
  </blockquote>