-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
57 lines (52 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
50
51
52
53
54
55
56
57
// @ts-check
const bundleAnalyzer = require('@next/bundle-analyzer')
const path = require('path')
const { i18n } = require('./next-i18next.config.js')
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
openAnalyzer: false,
})
/** @type {import('next').NextConfig} */
const nextConfig = {
i18n,
reactStrictMode: true,
poweredByHeader: false,
sassOptions: {
includePaths: [path.resolve(__dirname, 'src', 'styles')],
},
webpack: (config) => {
config.resolve.alias['@stratego'] = path.join(__dirname, 'src')
config.module.rules.push({
test: /\.pug$/,
loader: '@webdiscus/pug-loader',
options: {
method: 'compile',
embedFilters: {
escape: true,
markdown: true,
},
},
})
return config
},
redirects: async () => {
return [
{
source: '/',
destination: '/home',
permanent: true,
},
]
},
// Add environment variables to the client side
env: {
BRAND_NAME: process.env.BRAND_NAME ?? '',
BRAND_JURIDICAL_NAME: process.env.BRAND_JURIDICAL_NAME ?? '',
DEFAULT_PAGE_TITLE: process.env.DEFAULT_PAGE_TITLE ?? '',
DEFAULT_PAGE_DESCRIPTION: process.env.DEFAULT_PAGE_DESCRIPTION ?? '',
DEFAULT_ASSETS_SOURCE: process.env.DEFAULT_ASSETS_SOURCE ?? '',
DOCS_POSTS_SOURCE: process.env.DOCS_POSTS_SOURCE ?? '',
CAPTCHA_KEY: process.env.CAPTCHA_KEY ?? '',
},
}
module.exports = withBundleAnalyzer(nextConfig)