-
Notifications
You must be signed in to change notification settings - Fork 30
/
next.config.js
115 lines (108 loc) · 4.85 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* eslint-disable @typescript-eslint/no-var-requires */
const { i18n } = require('./next-i18next.config')
const { withSentryConfig } = require('@sentry/nextjs')
const isDev = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV
const isProd = process.env.NODE_ENV === 'production'
const envVars = {}
const sentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: true // Suppresses all logs
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
}
const moduleExports = {
async headers() {
return [
{
source: "/embed/player",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
{ key: "Access-Control-Allow-Headers", value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" },
]
}
]
},
reactStrictMode: true,
i18n,
sentry: {
disableServerWebpackPlugin: !isProd,
disableClientWebpackPlugin: !isProd
},
serverRuntimeConfig: {
IS_DEV: isDev,
API_PATH: process.env.API_PATH,
API_VERSION: process.env.API_VERSION,
API_DOMAIN: process.env.API_DOMAIN,
API_PROTOCOL: process.env.API_PROTOCOL,
WEB_PROTOCOL: process.env.WEB_PROTOCOL,
// Use PUBLIC_WEB_DOMAIN so variable renders properly for iMessage shared URLs,
// otherwise "podverse_web" (the docker variable name "podverse_web") will render
// in the URL. I'm not totally sure how/why the docker variable is not converting
// into the value on the server side...
WEB_DOMAIN: process.env.PUBLIC_WEB_DOMAIN,
APP_DOWNLOAD_ON_THE_APP_STORE_URL: process.env.APP_DOWNLOAD_ON_THE_APP_STORE_URL,
APP_GET_IT_ON_FDROID_URL: process.env.APP_GET_IT_ON_FDROID_URL,
APP_GET_IT_ON_GOOGLE_PLAY_URL: process.env.APP_GET_IT_ON_GOOGLE_PLAY_URL,
PAYPAL_ENV: process.env.PAYPAL_ENV,
PAYPAL_CLIENT_ID_PRODUCTION: process.env.PAYPAL_CLIENT_ID_PRODUCTION,
PAYPAL_CLIENT_ID_SANDBOX: process.env.PAYPAL_CLIENT_ID_SANDBOX,
EMAIL_CONTACT: process.env.EMAIL_CONTACT,
MATOMO_BASE_URL: process.env.MATOMO_BASE_URL,
MATOMO_ENDPOINT_PATH: process.env.MATOMO_ENDPOINT_PATH,
MATOMO_SITE_ID: process.env.MATOMO_SITE_ID,
V4V_APP_NAME: process.env.V4V_APP_NAME,
V4V_APP_RECIPIENT_CUSTOM_KEY: process.env.V4V_APP_RECIPIENT_CUSTOM_KEY,
V4V_APP_RECIPIENT_CUSTOM_VALUE: process.env.V4V_APP_RECIPIENT_CUSTOM_VALUE,
V4V_APP_RECIPIENT_LN_ADDRESS: process.env.V4V_APP_RECIPIENT_LN_ADDRESS,
V4V_APP_RECIPIENT_VALUE_DEFAULT: process.env.V4V_APP_RECIPIENT_VALUE_DEFAULT,
V4V_RECIPIENT_VALUE_DEFAULT: process.env.V4V_RECIPIENT_VALUE_DEFAULT
},
publicRuntimeConfig: {
IS_DEV: isDev,
API_PATH: process.env.API_PATH,
API_VERSION: process.env.API_VERSION,
API_DOMAIN: process.env.PUBLIC_API_DOMAIN,
API_PROTOCOL: process.env.PUBLIC_API_PROTOCOL,
WEB_PROTOCOL: process.env.PUBLIC_WEB_PROTOCOL,
WEB_DOMAIN: process.env.PUBLIC_WEB_DOMAIN,
APP_DOWNLOAD_ON_THE_APP_STORE_URL: process.env.APP_DOWNLOAD_ON_THE_APP_STORE_URL,
APP_GET_IT_ON_FDROID_URL: process.env.APP_GET_IT_ON_FDROID_URL,
APP_GET_IT_ON_GOOGLE_PLAY_URL: process.env.APP_GET_IT_ON_GOOGLE_PLAY_URL,
PAYPAL_ENV: process.env.PAYPAL_ENV,
PAYPAL_CLIENT_ID_PRODUCTION: process.env.PAYPAL_CLIENT_ID_PRODUCTION,
PAYPAL_CLIENT_ID_SANDBOX: process.env.PAYPAL_CLIENT_ID_SANDBOX,
EMAIL_CONTACT: process.env.EMAIL_CONTACT,
MATOMO_BASE_URL: process.env.MATOMO_BASE_URL,
MATOMO_ENDPOINT_PATH: process.env.MATOMO_ENDPOINT_PATH,
MATOMO_SITE_ID: process.env.MATOMO_SITE_ID,
V4V_APP_NAME: process.env.V4V_APP_NAME,
V4V_APP_RECIPIENT_CUSTOM_KEY: process.env.V4V_APP_RECIPIENT_CUSTOM_KEY,
V4V_APP_RECIPIENT_CUSTOM_VALUE: process.env.V4V_APP_RECIPIENT_CUSTOM_VALUE,
V4V_APP_RECIPIENT_LN_ADDRESS: process.env.V4V_APP_RECIPIENT_LN_ADDRESS,
V4V_APP_RECIPIENT_VALUE_DEFAULT: process.env.V4V_APP_RECIPIENT_VALUE_DEFAULT,
V4V_RECIPIENT_VALUE_DEFAULT: process.env.V4V_RECIPIENT_VALUE_DEFAULT
},
webpack(c) {
c.module.rules.push({
test: [
/src\/components\/index.tsx/i,
],
sideEffects: false,
});
return c;
}
}
if (process.env.SENTRY_AUTH_TOKEN || process.env.USE_SENTRY) {
module.exports = withSentryConfig(moduleExports, sentryWebpackPluginOptions)
} else {
console.log(
'SENTRY_AUTH_TOKEN was not found! If this is a production build please look at your environment variable configuration'
)
module.exports = moduleExports
}