title: How to fix webpack resolve-url-loader not working?
body: <p><strong>Resolve-url-loader</strong> is not resolving <strong>images/fonts</strong> in my <strong>css files.</strong> My folder structure is like this:</p>
  
  <pre><code>src 
     public
        images
             -banner-bg.jpg
        stylesheets
           css
             -basic.css with background: url(../../images/banner-bg.jpg)
           scss
             -main.scss with @import "../css/basic.css";
  
  </code></pre>
  
  <p>The output folders:</p>
  
  <pre><code>dist
    public
       images
             -banner-bg.jpg
       stylesheets
             -main-output.css
  </code></pre>
  
  <p>The images &amp; fonts diplay ok in dev server and are correctly copied in production. The <strong>main-output.css</strong> - when examined - shows </p>
  
  <p><code>background:url(public/images/banner-bg.jpg</code> </p>
  
  <p>instead of the expected</p>
  
  <p><code>background:url(../images/banner-bg.jpg)</code> </p>
  
  <p>And the browser console shows the error:</p>
  
  <p>GET file:///home/ustrd/Documents/myproject12/dist/ <strong>public/stylesheets/public/images/</strong> banner-bg.jpg net::ERR_FILE_NOT_FOUND</p>
  
  <pre><code>plugins: [
     new MiniCssExtractPlugin({
       filename: path.join("public", "stylesheets", "[name].css")
     })
   ],
   module: {
     rules: [
       {
         test: /\.(css|scss)$/,
         use: [
           MiniCssExtractPlugin.loader, 
           {
             loader: "css-loader",
             options: {
               sourceMap: true,
               importLoaders: 2
             }
           },
           {
             loader: "postcss-loader",
             options: {
               ident: "postcss",
               plugins: () =&gt; [new PostcssPresetEnv()]
             }
           },
           {
             loader: "resolve-url-loader",
             options: { sourceMap: true }
           },
           { loader: "sass-loader", options: { sourceMap: true } } 
         ]
       },
  
  </code></pre>
  
  <p>Any ideas how to fix that?</p>