This repository was archived by the owner on May 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathconfig.js
45 lines (35 loc) · 1.59 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const { join } = require("path");
const getNextDistDir = require("./helpers/getNextDistDir");
// This is where next-on-netlify will place all static files.
// The publish key in netlify.toml should point to this folder.
const NETLIFY_PUBLISH_PATH = join(".", "out_publish/");
// This is where next-on-netlify will place all Netlify Functions.
// The functions key in netlify.toml should point to this folder.
const NETLIFY_FUNCTIONS_PATH = join(".", "out_functions/");
// This is where static assets, such as images, can be placed. They will be
// copied as-is to the Netlify publish folder.
const PUBLIC_PATH = join(".", "public/");
// This is the file where NextJS can be configured
const NEXT_CONFIG_PATH = join(".", "next.config.js");
// This is the folder that NextJS builds to; default is .next
const NEXT_DIST_DIR = getNextDistDir({ nextConfigPath: NEXT_CONFIG_PATH });
// This is the folder with templates for Netlify Functions
const TEMPLATES_DIR = join(__dirname, "templates");
// This is the Netlify Function template that wraps all SSR pages
const FUNCTION_TEMPLATE_PATH = join(TEMPLATES_DIR, "netlifyFunction.js");
// This is the file where custom redirects can be configured
const CUSTOM_REDIRECTS_PATH = join(".", "_redirects");
// This is the name used for copying our imageFunction template and for
// creating the next/image redirect
const NEXT_IMAGE_FUNCTION_NAME = "next_image";
module.exports = {
NETLIFY_PUBLISH_PATH,
NETLIFY_FUNCTIONS_PATH,
PUBLIC_PATH,
NEXT_CONFIG_PATH,
NEXT_DIST_DIR,
TEMPLATES_DIR,
FUNCTION_TEMPLATE_PATH,
CUSTOM_REDIRECTS_PATH,
NEXT_IMAGE_FUNCTION_NAME,
};