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 withCss = require('@zeit/next-css')
|
||||||
const withSass = require('@zeit/next-sass')
|
const withSass = require('@zeit/next-sass')
|
||||||
const { range } = require('lodash')
|
const { range } = require('lodash')
|
||||||
const fs = require('fs').promises
|
|
||||||
|
|
||||||
function createPath(page, map, query, items) {
|
function createPath(page, map, query, items) {
|
||||||
return items.reduce((acc, path) => {
|
return items.reduce((acc, path) => {
|
||||||
@@ -24,8 +23,6 @@ module.exports = withCss(withSass({
|
|||||||
// secondSecret: process.env.SECOND_SECRET // Pass through env variables
|
// secondSecret: process.env.SECOND_SECRET // Pass through env variables
|
||||||
},
|
},
|
||||||
exportPathMap: async (defaultPathMap, { dev }) => {
|
exportPathMap: async (defaultPathMap, { dev }) => {
|
||||||
await fs.copyFile('./public/robots.txt', './dist/robots.txt')
|
|
||||||
|
|
||||||
if (dev) {
|
if (dev) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -7,9 +7,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "NODE_ENV=production node src/server.js",
|
"start": "NODE_ENV=production node src/server.js",
|
||||||
"dev": "node src/server.js",
|
"dev": "node src/server.js",
|
||||||
"next": "next",
|
"build": "next build && next export -o dist && npm run sitemap && npm run feed && npm run robots-txt",
|
||||||
"build": "next build",
|
"robots-txt": "node scripts/robots-txt.js",
|
||||||
"export": "npm run build && next export -o dist && npm run sitemap && npm run feed",
|
|
||||||
"sitemap": "node scripts/sitemap.js",
|
"sitemap": "node scripts/sitemap.js",
|
||||||
"feed": "node scripts/feed.js",
|
"feed": "node scripts/feed.js",
|
||||||
"test": "mocha --compilers js:babel-register"
|
"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