-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
65 lines (62 loc) · 1.61 KB
/
next.config.js
File metadata and controls
65 lines (62 loc) · 1.61 KB
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
/* eslint-disable @typescript-eslint/no-require-imports */
const dotenv = require('dotenv');
const path = require('path');
const { existsSync } = require('fs');
module.exports = async () => {
const envFile = `.env.${process.env.APP_ENV || 'local'}`;
const envPath = path.join(__dirname, envFile);
const isLocal = process.env.NODE_ENV === 'development';
if (existsSync(envPath)) {
dotenv.config({ path: envPath });
} else {
console.error(`Env file not found: ${envPath}`);
}
return {
i18n: {
locales: ['en', 'ru', 'hy'],
defaultLocale: 'en',
},
assetPrefix: isLocal ? '' : '/uxcore_next',
output: 'standalone',
async rewrites() {
return [
{
source: '/assets/:path*',
destination: '/uxcore_/assets/:path*',
},
{
source: '/fonts/:path*',
destination: '/uxcore_/fonts/:path*',
},
{
source: '/audio/:path*',
destination: '/uxcore_/audio/:path*',
},
{
source: '/static/:path*',
destination: '/uxcore_/static/:path*',
},
{
source: '/robots.txt',
destination: '/uxcore_/robots.txt',
},
];
},
experimental: {
manualClientBasePath: true,
},
compiler: {
removeConsole:
process.env.NODE_ENV === 'prod' ? { exclude: ['error'] } : false,
},
images: {
domains: [
'lh3.googleusercontent.com',
'cdn.discordapp.com',
'strapi.keepsimple.io',
'staging-strapi.keepsimple.io',
],
},
productionBrowserSourceMaps: true,
};
};