-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
94 lines (88 loc) · 1.83 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
/**
* @type {import('next').NextConfig}
*/
// const withImages = require('next-images');
const nextConfig = {
sassOptions: {
additionalData: `@import "src/assets/styles/variables.scss"; @import "src/assets/styles/mixins.scss";`,
},
i18n: {
locales: ['en', 'ru', 'ua'],
defaultLocale: 'ua',
localeDetection: false,
},
exportPathMap: async () => {
const paths = {
'/': {
page: '/',
query: {
lang: 'ua',
__nextDefaultLocale: 'ua',
__nextLocale: 'ua',
},
},
'/catalog': {
page: '/catalog',
query: {
lang: 'ua',
__nextDefaultLocale: 'ua',
__nextLocale: 'ua',
},
},
'/services': {
page: '/services',
query: {
lang: 'ua',
__nextDefaultLocale: 'ua',
__nextLocale: 'ua',
},
},
};
const languages = ['en', 'ru', 'ua'];
const defaultLanguage = 'ua';
for (const language of languages) {
paths[`/${language}`] = {
page: `/${language}`,
query: {
lang: language,
__nextDefaultLocale: defaultLanguage,
__nextLocale: language,
},
};
paths[`/${language}/services`] = {
page: '/services',
query: {
lang: language,
__nextDefaultLocale: defaultLanguage,
__nextLocale: language,
},
};
paths[`/${language}/catalog`] = {
page: '/catalog',
query: {
lang: language,
__nextDefaultLocale: defaultLanguage,
__nextLocale: language,
},
};
}
return paths;
},
webpack: (config, {isServer}) => {
config.module.rules.push({
test: /\.(mp4|webm|mov)$/,
use: {
loader: 'url-loader',
options: {
limit: 500 * 1024 * 1024,
fallback: 'file-loader',
publicPath: '/_next/static/media/',
outputPath: `${isServer ? '../' : ''}/_next/static/media/`,
name: '[name].[ext]',
},
},
});
return config;
},
};
export default nextConfig;