title: "fetch is not defined" on vuepress build
body: <p>I am trying to build a static site with vuepress. I have a vue component that is used that uses the javascript <code>fetch</code> library. It looks like this:</p>
  <pre><code>&lt;template&gt;
  &lt;div&gt;
      &lt;p&gt; {{totalVuePackages}} &lt;/p&gt;
  &lt;/div&gt;
  &lt;/template&gt;
  
  &lt;script&gt;
  export default {
    name: &quot;get-request&quot;,
    data() {
      return {
        totalVuePackages: null
      };
    },
    created() {
      fetch(&quot;https://api.npms.io/v2/search?q=vue&quot;)
        .then(response =&gt; response.json())
        .then(data =&gt; (this.totalVuePackages = data.total));
    }
  };
  &lt;/script&gt;
  </code></pre>
  <p>If I use <code>vuepress dev</code> it works perfectly with no errors. However, when I use <code>vuepress build</code> I get the following error:</p>
  <pre><code>ReferenceError: fetch is not defined
  </code></pre>
  <p>I'm new to vue and javascript, but I was under the assumption that <code>fetch</code> is a built-in javascript method that runs on the clientside.</p>