The current setup has been tested on Next Js 7.0.0.
You need to install Axios.
$ npm install axios
| import { useRouter } from 'next/router'; | |
| import React, { useEffect, useState } from 'react'; | |
| interface DelayProps { | |
| delay: number; | |
| to: string; | |
| banner: boolean; | |
| showCount: boolean; | |
| } |
| #! /usr/bin/env node | |
| // I am ./bin/buildSitemap.js | |
| const path = require('path') | |
| const glob = require('glob') | |
| const fs = require('fs') | |
| const SITE_ROOT = process.env.SITE_ROOT || 'https://www.actionherojs.com' | |
| const SOURCE = process.env.SOURCE || path.join(__dirname, '..', 'pages', '/**/*.js') | |
| const DESTINATION = process.env.DESTINATION || path.join(__dirname, '..', 'static', 'sitemap.xml') |