forked from nemanjam/nextjs-prisma-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
49 lines (48 loc) · 1.47 KB
/
next.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
46
47
48
49
const path = require('path');
module.exports = {
reactStrictMode: true,
trailingSlash: true,
experimental: {
// maybe fixes hydration error
// https://github.com/vercel/next.js/issues/35564#issuecomment-1077347776
// https://github.com/facebook/react/issues/24125
runtime: 'nodejs',
serverComponents: true,
reactRoot: true,
},
/*
webpackDevMiddleware: (config) => {
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300,
};
return config;
},
*/
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
// buildtime, must provide buildtime in Dockerfile or hardcode
env: {
// used in axios instance, just rename it
// with '/', no need to trim it anywhere
// all paths have '/'
NEXT_PUBLIC_BASE_URL: `${process.env.NEXTAUTH_URL}/`,
NEXT_PUBLIC_POSTS_PER_PAGE: 5,
NEXT_PUBLIC_USERS_PER_PAGE: 3,
NEXT_PUBLIC_DEFAULT_THEME: 'theme-blue',
},
// runtime, server, private
serverRuntimeConfig: {
// just forward entire env.local
// only used in [...nextauth]
SECRET: process.env.SECRET,
FACEBOOK_CLIENT_ID: process.env.FACEBOOK_CLIENT_ID,
FACEBOOK_CLIENT_SECRET: process.env.FACEBOOK_CLIENT_SECRET,
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET,
},
// runtime, server, ssr client, public, don't need to recompile app
// server and getServersideProps pages/components
publicRuntimeConfig: {},
};