title: Images have absolute path - How to use a subdirectory URL in LaravelMix
body: <p>My Laravel Mix app will be placed in a subdirectory on the server like: <em><a href="http://localhost/pat-os-server/public/" rel="noreferrer">http://localhost/pat-os-server/public/</a></em></p>
  
  <p>An image's path in my vue component compiles from</p>
  
  <pre><code>&lt;img id="logo" src="../assets/img/pat_logo.png"&gt;
  </code></pre>
  
  <p>To</p>
  
  <pre><code>&lt;img id="logo" src="/images/pat_logo.png"&gt;
  </code></pre>
  
  <p>Now the image is not shown due to the subdirectory the app is in. The correct path should be either <strong><em>images/pat_logo.png</em></strong> (relative - prefered) or <strong><em>/pat-os-server/public/images/pat_logo.png</em></strong> (absolute)</p>
  
  <p>I've tried to set the output path in webpack.mix.js like this:</p>
  
  <pre><code>mix.setPublicPath('/pat-os-server/public/');
  mix.setResourceRoot('/pat-os-server/public/');
  </code></pre>
  
  <p>But that doesn't change the output path. It's still <strong><em>/images/pat_logo.png</em></strong>. I expect it to be <strong><em>/pat-os-server/public/images/pat_logo.png</em></strong> now. Using other values for setPublicPath and setResourceRoot including "/" and "" doesn't caused any difference.</p>
  
  <p>I've placed the path setting methods before calling other methods, so my current webpack.mix.js looks like this:</p>
  
  <pre><code>const { mix } = require('laravel-mix');
  
  mix.setPublicPath('/pat-os-server/public/');
  mix.setResourceRoot('/pat-os-server/public/');
  mix.js('resources/assets/js/app.js', 'public/js')
     .sass('resources/assets/sass/app.scss', 'public/css');
  </code></pre>
  
  <p>How do I get a relative output path for my images or change the absolute path?</p>
  
  <p>Thanks for your support.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I've just realized, that a subfolder "pat-os-server" was created inside my laravel project and all compiled project files where copied into this subfolder. So it seems I missunderstood the setPublicPath setting.</p>
  
  <p>I <em>don't</em> want to place the output files into another folder. I want the URLs in my project to point to the correct path which is not the host/root but a subdirectory.</p>