<h1 dir="auto">Bug report</h1>
<p dir="auto">Webpack v4.12 is not respecting setting the mode via config file.</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">If I set the mode with module.exports in the webpack.config.js, I receive the configuration warning that the mode is not set.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">If I make a <code class="notranslate">webpack.config.js</code> in the root with this configuration:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
  mode: 'none'
};"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">mode</span>: <span class="pl-s">'none'</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">And I run <code class="notranslate">npm run webpack</code> via the webpack in scripts in my package.json:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" &quot;scripts&quot;: {
    &quot;webpack&quot;: &quot;webpack&quot;,
  }"><pre class="notranslate"> <span class="pl-s">"scripts"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"webpack"</span>: <span class="pl-s">"webpack"</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span></pre></div>
<p dir="auto">But I receive the configuration warning that the mode is not set.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="configuration
  0:0  warning  The 'mode' option has not been set, webpack will fallback to
                'production' for this value. Set 'mode' option to 'development' or
                'production' to enable defaults for each environment."><pre class="notranslate"><code class="notranslate">configuration
  0:0  warning  The 'mode' option has not been set, webpack will fallback to
                'production' for this value. Set 'mode' option to 'development' or
                'production' to enable defaults for each environment.
</code></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Same exact config sets the mode just fine in v4.8 with no configuration warning.... but not in v4.12. The webpack documentation does not outline any sort of changes with this process <a href="https://webpack.js.org/concepts/mode/#mode-none" rel="nofollow">https://webpack.js.org/concepts/mode/#mode-none</a> -- so I'm guessing this is a bug.</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  v4.12<br>
Node.js version: v9.9<br>
Operating System: macOS<br>
Additional tools: VS Code</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">Report a bug</p>


<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">When i load the files from <code class="notranslate">scss</code> in webpack.dev the filepath is good:</p>
<p dir="auto"><code class="notranslate">background: url('../imgs/photo.jpg');</code></p>
<p dir="auto">But after build filepath is:</p>
<p dir="auto"><code class="notranslate">background: url('assets/imgs/photo.jpg');</code></p>
<p dir="auto">I don't know why it changes <code class="notranslate">../</code> with <code class="notranslate">assets</code>.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>



<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">after <code class="notranslate">npm run build</code> the url image from <code class="notranslate">css</code> should be same as in <code class="notranslate">scss </code>file</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.</strong></p>
<p dir="auto">Node.js version: <code class="notranslate">v10.16.0</code>,<br>
Webpack version: <code class="notranslate">4.36.1</code>,<br>
OS: <code class="notranslate">Windows 10</code></p>
<p dir="auto">Main Config:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080802-b663f500-bf4a-11e9-8296-a33795b07636.png"><img src="https://user-images.githubusercontent.com/37197922/63080802-b663f500-bf4a-11e9-8296-a33795b07636.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Development Config:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080836-cda2e280-bf4a-11e9-8cee-bde7be93bbac.png"><img src="https://user-images.githubusercontent.com/37197922/63080836-cda2e280-bf4a-11e9-8cee-bde7be93bbac.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Build / Production Config:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080858-d98ea480-bf4a-11e9-8321-6ed43de79d97.png"><img src="https://user-images.githubusercontent.com/37197922/63080858-d98ea480-bf4a-11e9-8321-6ed43de79d97.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">And this is my folder structure for development files:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080880-e27f7600-bf4a-11e9-9c93-e75ef0ea9c1d.png"><img src="https://user-images.githubusercontent.com/37197922/63080880-e27f7600-bf4a-11e9-9c93-e75ef0ea9c1d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">And end build files:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63080904-ef03ce80-bf4a-11e9-8296-c63cca0a599f.png"><img src="https://user-images.githubusercontent.com/37197922/63080904-ef03ce80-bf4a-11e9-8296-c63cca0a599f.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">As you can see from style.scss, the filepath: <code class="notranslate">../imgs/photo,jpg works perfectly</code>.<br>
But from the dist folder it changes to <code class="notranslate">assets/imgs/photo.jpg</code>.</p>
<p dir="auto">And after i tried with <code class="notranslate">resolve-url-loader</code> it gives me this error after build:</p>
<p dir="auto">config with <code class="notranslate">resolve-url-loader</code>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63081295-f081c680-bf4b-11e9-869e-60f0616d798c.png"><img src="https://user-images.githubusercontent.com/37197922/63081295-f081c680-bf4b-11e9-869e-60f0616d798c.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63081242-ce884400-bf4b-11e9-8702-ce858cabddd7.png"><img src="https://user-images.githubusercontent.com/37197922/63081242-ce884400-bf4b-11e9-8702-ce858cabddd7.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37197922/63081262-d8aa4280-bf4b-11e9-964b-048a57e111e3.png"><img src="https://user-images.githubusercontent.com/37197922/63081262-d8aa4280-bf4b-11e9-964b-048a57e111e3.png" alt="image" style="max-width: 100%;"></a></p>