build config updated
copying robots.txt moved to separate script export script merged with build script
This commit is contained in:
1 parent
0ae9601309
commit
dded475c47
3 files changed
+7
-6
No files matched your search
@@ -1,7 +1,6 @@
|
||||
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) => {
|
||||
@@ -24,8 +23,6 @@ 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
|
||||
}
|
||||
|
||||
+2
-3
@@ -7,9 +7,8 @@
|
||||
"scripts": {
|
||||
"start": "NODE_ENV=production node src/server.js",
|
||||
"dev": "node src/server.js",
|
||||
"next": "next",
|
||||
"build": "next build",
|
||||
"export": "npm run build && next export -o dist && npm run sitemap && npm run feed",
|
||||
"build": "next build && next export -o dist && npm run sitemap && npm run feed && npm run robots-txt",
|
||||
"robots-txt": "node scripts/robots-txt.js",
|
||||
"sitemap": "node scripts/sitemap.js",
|
||||
"feed": "node scripts/feed.js",
|
||||
"test": "mocha --compilers js:babel-register"
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
const fs = require('fs').promises;
|
||||
|
||||
(async () => {
|
||||
await fs.copyFile('public/robots.txt', 'dist/robots.txt')
|
||||
})()
|
||||
Reference in new issue
Block a user