-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnext.config.mjs
52 lines (49 loc) · 1.7 KB
/
next.config.mjs
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
/** @type {import('next').NextConfig} */
import withLinaria from 'next-with-linaria';
// This file sets a custom webpack configuration to use your Next.js app
// with Sentry.
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
if (process.env.NODE_ENV !== 'production') {
import('dotenv').then(({ config }) => config());
}
const getBotNameByDomain = domain => {
switch (domain) {
case 'tonapi.io':
return 'tonapi_auth_bot';
case 'testnet.tonapi.io':
return 'tonapi_auth_testnet_bot';
case 'dev.tonapi.io':
default:
return 'tonapi_auth_dev_bot';
}
};
export default withLinaria({
reactStrictMode: true,
swcMinify: false,
env: {
hostName: process.env.HOST_NAME,
host: `https://${process.env.HOST_NAME}`,
exchangeHost: 'https://data2.ton.app/stock',
authBotName: getBotNameByDomain(process.env.HOST_NAME),
tonApiToken: process.env.TON_API_TOKEN,
isTestOnly: process.env.IS_TEST_ONLY === 'true',
authClientToken: process.env.AUTH_TOKEN_CLIENT,
authServerToken: process.env.AUTH_TOKEN_SSR
},
images: {
domains: ['robohash.org', 't.me']
},
// Append the default value with md extensions
pageExtensions: ['page.ts', 'page.tsx'],
sentry: {
// Use `hidden-source-map` rather than `source-map` as the Webpack `devtool`
// for client-side builds. (This will be the default starting in
// `@sentry/nextjs` version 8.0.0.) See
// https://webpack.js.org/configuration/devtool/ and
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#use-hidden-source-map
// for more information.
hideSourceMaps: true
},
distDir: 'build'
});