title: vue-server-renderer: window/document not defined in third packages
body: <p>I'm using vue with ssr. (vue-server-renderer).</p>
  
  <p>I get errors: <code>document not defined</code> / <code>window not defined</code> / <code>window.addEventLis… not defined</code>, when I try to use <code>renderToString</code> function.</p>
  
  <p>Now I know window and document object doesn't not exist on the server side. so I use <code>no-ssr</code> package, that not render the components which have document and window inside.</p>
  
  <p>But what about import statements? such as </p>
  
  <pre><code> import muuri from 'muuri'; 
   // or
   import anime from 'animejs/lib/anime.es.js';
  </code></pre>
  
  <p>those packages doesn't have ssr compatibility. they access the dom indirect.</p>
  
  <p>so when the render is run, it try to evaluate those library, and failed cause document/window not defined.</p>
  
  <p>This step happends <strong>before</strong> the vue application is running. when webpack try to resolve the modules.</p>
  
  <p>So what can I do about this?</p>