generated from SocialGouv/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
35 lines (29 loc) · 919 Bytes
/
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
const { withSentryConfig } = require("@sentry/nextjs");
const { version } = require("./package.json");
const ContentSecurityPolicy = require("./csp.config");
const withTM = require("next-transpile-modules")(["@codegouvfr/react-dsfr"]);
/** @type {import('next').NextConfig} */
const moduleExports = {
reactStrictMode: true,
swcMinify: true,
webpack: (config) => {
config.module.rules.push({
test: /\.(woff2|webmanifest)$/,
type: "asset/resource",
});
return config;
},
sentry: {
disableClientWebpackPlugin: true,
disableServerWebpackPlugin: true,
},
env: {
NEXT_PUBLIC_APP_VERSION: version,
NEXT_PUBLIC_APP_VERSION_COMMIT: process.env.GITHUB_SHA,
NEXT_PUBLIC_IS_PRODUCTION_DEPLOYMENT: process.env.PRODUCTION,
CONTENT_SECURITY_POLICY: ContentSecurityPolicy,
},
};
module.exports = {
...withTM(withSentryConfig(moduleExports, { silent: true })),
};