title: Django webpack loader respecting STATICFILES_STORAGE setup
body: <p>I have a Django project that uses webpack loader to work with vue with the following settings</p>
  <pre><code>DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
  STATICFILES_STORAGE = 'storages.backends.s3boto3.S3StaticStorage'
  </code></pre>
  <p>So, for example, if we hav <code>&lt;script src=&quot;{% static &quot;js/main.js&quot; %}&quot;&gt;&lt;/script&gt;</code>, Django will convert it, into, say, <code>https://my_service_url.com/static/js/main.js</code></p>
  <p>That's fine.</p>
  <p>But the trouble starts with bundles generated by webpack loader, for which I have the following settings</p>
  <pre><code>WEBPACK_LOADER = {
    'DEFAULT': {
      'CACHE': False,
      'BUNDLE_DIR_NAME': '/bundles/',  # must end with slash
      'STATS_FILE': os.path.join(FRONTEND_DIR, 'webpack-stats.json'),
      'POLL_INTERVAL': 0.1,
      'IGNORE': [r'.+\.hot-update.js', r'.+\.map'],
    }
  }
  </code></pre>
  <p>And in my vue.config.js file</p>
  <pre><code>const BundleTracker = require(&quot;webpack-bundle-tracker&quot;);
  
  const pages = {
      ...
  }
  
      module.exports = {
          publicPath: '/static/',
          outputDir: './dist/',
          chainWebpack: config =&gt; {
              config.optimization
                  .splitChunks(false)
              config
                  .plugin('BundleTracker')
                  .use(BundleTracker, [{filename: '../frontend/webpack-stats.json'}])
              config.resolve.alias
                  .set('__STATIC__', 'static')
              config.devServer
                  .public('/static/')
                  .host('0.0.0.0')
                  .port(8080)
                  .hotOnly(true)
                  .watchOptions({poll: 1000})
                  .https(false)
                  .headers({&quot;Access-Control-Allow-Origin&quot;: [&quot;\*&quot;]})
          },
          pages: pages
      };
  </code></pre>
  <p>So, the issue is that under this setup, Django tries to look up the bundles using the address</p>
  <p>http://localhost:8006/static/js/my_bundle.js</p>
  <p>instead of <code>https://my_service_url.com/static/js/my_bundle.js</code></p>
  <p>How do I make this work ? I guess I have to adjust the <code>module.exports</code> somehow...</p>