-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.ts
90 lines (79 loc) · 2.18 KB
/
next.config.ts
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
import { NextConfig } from 'next'
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
defaultSizes: 'gzip',
openAnalyzer: false,
})
const nextConfig: NextConfig = {
reactStrictMode: 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: '/login/cej', destination: '/login', permanent: true },
{ source: '/login/passemploi', destination: '/login', 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*',
},
],
afterFiles: [],
fallback: [],
}),
compiler: {
// https://nextjs.org/docs/advanced-features/compiler#remove-react-properties
reactRemoveProperties: true,
},
webpack(config: any) {
// 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: process.env.NODE_ENV,
})
)
return config
},
}
export default withBundleAnalyzer(nextConfig)