-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
85 lines (75 loc) · 1.96 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
/** @type {import('next').NextConfig} */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
defaultSizes: 'gzip',
openAnalyzer: false,
})
module.exports = withBundleAnalyzer({
reactStrictMode: true,
swcMinify: true,
productionBrowserSourceMaps: true,
env: {
APP: process.env.APP, // NEXT_PUBLIC_APP=$APP not working client side
},
async redirects() {
return [
{
source: '/index',
destination: '/',
permanent: true,
},
{
source: '/mes-jeunes/milo',
destination: '/mes-jeunes',
permanent: true,
},
{
source: '/mes-jeunes/pole-emploi',
destination: '/mes-jeunes',
permanent: true,
},
{
source: '/mes-jeunes/:idJeune/actions',
destination: '/mes-jeunes/:idJeune?onglet=actions',
permanent: true,
},
{
source: '/mes-jeunes/milo/:numeroDossier',
destination: '/api/milo/:numeroDossier',
permanent: true,
},
{ source: '/recherche-offres', destination: '/offres', permanent: true },
]
},
i18n: {
locales: ['fr-FR'],
defaultLocale: 'fr-FR',
},
rewrites: async () => ({
beforeFiles: [
{
source: '/etablissement/beneficiaires/:path*',
destination: '/mes-jeunes/:path*',
},
],
}),
compiler: {
// https://nextjs.org/docs/advanced-features/compiler#remove-react-properties
reactRemoveProperties: true,
},
webpack(config) {
// https://react-svgr.com/docs/next/
config.module.rules.push({
test: /\.svg$/i,
use: [{ loader: '@svgr/webpack', options: { titleProp: true } }],
})
// https://www.elastic.co/guide/en/apm/agent/rum-js/current/install-the-agent.html#using-bundlers
const { EnvironmentPlugin } = require('webpack')
config.plugins.push(
new EnvironmentPlugin({
NODE_ENV: 'production',
})
)
return config
},
})