title: Nextjs export clear "out" folder
body: <p>I'm working with nextjs and this example <a href="https://github.com/zeit/next.js/tree/master/examples/with-static-export" rel="nofollow noreferrer">https://github.com/zeit/next.js/tree/master/examples/with-static-export</a></p>
  
  <p>in next.config.js i have code:</p>
  
  <pre><code>module.exports = {
    async exportPathMap(defaultPathMap, { dev, dir, outDir, distDir, buildId, incremental }) {
      // we fetch our list of posts, this allow us to dynamically generate the exported pages
      const response = await fetch(
        'https://jsonplaceholder.typicode.com/posts?_limit=3'
      )
      const postList = await response.json()
  
      // tranform the list of posts into a map of pages with the pathname `/post/:id`
      const pages = postList.reduce(
        (pages, post) =&gt;
          Object.assign({}, pages, {
            [`/post/${post.id}`]: { page: '/post/[id]' },
          }),
        {}
      )
  
      // combine the map of post pages with the home
      return Object.assign({}, pages, {
        '/': { page: '/' },
      })
    },
  }
  </code></pre>
  
  <p>Its fetch 3 posts and generate files - [id].html - its great!</p>
  
  <p>But now i need to fetch new post and build page only for this new post but commad <strong>next export</strong> remove all files from out and create only one post.</p>
  
  <p>What i need to do to keep old post and add new one on next export?</p>
  
  <p>Example:</p>
  
  <ul>
  <li>First next export with request for 3 posts from api</li>
  <li>generate 3 post in folder "out"</li>
  <li>change api url and run next export for 1 new post</li>
  <li>summary i have 3 old post pages and 1 new in my "out" directory</li>
  </ul>
  
  <p>How to do that?</p>