title: How to assign a function when doing proxy context matching in the webpack-dev-server's proxy config?
body: <p>For example of my <code>webpack.config.js</code>:</p>
  
  <pre><code>module.exports = {
      devServer: {
          proxy: {
              '/api': {
                  target: 'http://localhost:3000',
                  pathRewrite: {'/api': ''}
              }
          }
      },
      ....
  }
  </code></pre>
  
  <p>Here, I used <code>/api</code> to match one url rule. But I looked into <code>http-proxy-middleware</code> which is the base of the <code>webpack-dev-server</code>'s <code>proxy</code>, it said that we can use a <code>filter function</code> to do the <code>custom match</code>:</p>
  
  <pre><code>var filter = function (pathname, req) {
      return (pathname.match('^/api') &amp;&amp; req.method === 'GET');
  };
  var apiProxy = proxy(filter, {target: 'http://www.example.org'})
  </code></pre>
  
  <p>But in <code>webpack.config.js</code>, how could I use a <code>filter function</code> to do my <code>custom match</code>? Thanks.</p>