robots.txt + sitemap.xml

This commit is contained in:
tmshv committed 2019-08-03 19:02:07 +03:00
1 parent 5ab2084763
commit 1b77f6b2de
6 files changed
+85 -88

No files matched your search

+3
View File
@@ -1,6 +1,7 @@
const withCss = require('@zeit/next-css')
const withSass = require('@zeit/next-sass')
const { range } = require('lodash')
const fs = require('fs').promises
function createPath(page, map, query, items) {
return items.reduce((acc, path) => {
@@ -22,6 +23,8 @@ module.exports = withCss(withSass({
// secondSecret: process.env.SECOND_SECRET // Pass through env variables
},
exportPathMap: async (defaultPathMap, { dev }) => {
await fs.copyFile('./public/robots.txt', './dist/robots.txt')
if (dev) {
return null
}