title: npm argument results in "Insufficient number of arguments or no entry found"
body: <p>I try to pass a custom flag from npm script to my webpack config but it results in following error. The logs</p>
  
  <pre><code>Insufficient number of arguments or no entry found.
  Alternatively, run 'webpack(-cli) --help' for usage info.
  
  ERROR in Entry module not found: Error: Can't resolve '--no-dist' in 'C:\Users\user\gitroot\MyProject\sharepoint'
  npm ERR! code ELIFECYCLE
  npm ERR! errno 2
  npm ERR! my-project@4.0.0 dev: `webpack --mode development -- --no-dist`
  npm ERR! Exit status 2
  npm ERR!
  npm ERR! Failed at the my-project@4.0.0 dev script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>...
  "scripts": {
      "dev": "webpack --mode development -- --no-dist",
      "dev:dist": "webpack --mode development",
      "build": "webpack --mode production"
  },
  ...
  </code></pre>
  
  <p><strong>webpack.config.js</strong></p>
  
  <pre><code>let username = process.env.USERNAME;
  if (process.env.npm_config_user !== undefined &amp;&amp; process.env.npm_config_user !== "") {
      username = process.env.npm_config_user;
  }
  console.log("username", username);
  console.log("process.argv.slice(2)", process.argv.slice(2));
  const no_dist = process.argv.slice(2).indexOf("--no-dist") &gt; -1;
  console.log("no_dist", no_dist);
  </code></pre>
  
  <p><strong>Tests</strong></p>
  
  <ol>
  <li><code>npm run dev:dist</code></li>
  </ol>
  
  <p>This works without errors, it gets bundled and distributed without problems. Gives the following output:</p>
  
  <pre><code>username user
  process.argv.slice(2) [ '--mode', 'development' ]
  no_dist false
  </code></pre>
  
  <ol start="2">
  <li><code>npm run dev:dist --user test</code></li>
  </ol>
  
  <p>Also works and gives the following output:</p>
  
  <pre><code>username test
  process.argv.slice(2) [ '--mode', 'development' ]
  no_dist false
  </code></pre>
  
  <ol start="3">
  <li><code>npm run dev</code></li>
  </ol>
  
  <p>Here it gets interesting, I try to run the dev script which has a <code>--no-dist</code> flag. Output:</p>
  
  <pre><code>username user
  process.argv.slice(2) [ '--mode', 'development', '--', '--no-dist' ]
  no_dist true
  </code></pre>
  
  <p>As you can see, <code>no_dist</code> boolean is set to true, which is the wanted behaviour. But I get the following error:</p>
  
  <pre><code>Insufficient number of arguments or no entry found.
  Alternatively, run 'webpack(-cli) --help' for usage info.
  </code></pre>
  
  <ol start="4">
  <li><code>npm run dev --user test</code></li>
  </ol>
  
  <p>Same behaviour as test 3. The arguments are passed to the webpack.config.js but result in the same error.</p>
  
  <pre><code>username test
  process.argv.slice(2) [ '--mode', 'development', '--', '--no-dist' ]
  no_dist true
  </code></pre>
  
  <hr>
  
  <p>Am I missing something here?</p>