title: Webpack dev-server proxy with query params
body: <p>I'm trying to <a href="https://webpack.js.org/configuration/dev-server/#devserver-proxy" rel="noreferrer">proxy</a> my a request with dynamic query parameters, but seem to either get a 404 error or no response at all.  This is what I've tried so far:</p>
  
  <pre><code>'/services/app/details.json?id=*': {
      target: 'https://website.com/api/v1/potato/',
      changeOrigin: true,
      secure: true,
      pathRewrite: {
        '^/services/app/details.json?id=': '',
      },
  }
  </code></pre>
  
  <p>I'm expecting the request from my local machine (<code>/services/app/details.json?id=2189</code>) to proxy to <code>https://website.com/api/v1/potato/2189</code> however it seems that the <code>id</code> is not appended to the target request and results in a 404 error.</p>
  
  <p>I tried using the <code>bypass</code> method to append the id myself which instead gives me no response object.</p>
  
  <pre><code>'/services/app/details.json?id=*': {
      target: 'https://website.com/api/v1/potato/',
      changeOrigin: true,
      secure: true,
      pathRewrite: {
        '^/services/app/details.json?id=': '',
      },
      bypass(req, res, proxyOptions) {
        const id = (req.query.id ? req.query.id : '');
  
        const API = Object.assign({}, proxyOptions, {
          target: proxyOptions.target + id,
        });
  
        return API.target;
      },
  }
  </code></pre>
  
  <p>Does anyone have experience with this?</p>