forked from SocialGouv/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
46 lines (40 loc) · 1.14 KB
/
next.config.mjs
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
import { withSentryConfig } from "@sentry/nextjs";
import createMDX from "@next/mdx";
import remarkGfm from "remark-gfm";
import ContentSecurityPolicy from "./csp.config.mjs";
import pkg from "./package.json" assert { type: "json" };
const withMDX = createMDX({
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [],
},
});
const version = pkg.version;
/** @type {import('next').NextConfig} */
const moduleExports = {
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
reactStrictMode: true,
swcMinify: true,
output: "export",
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,
CONTENT_SECURITY_POLICY: ContentSecurityPolicy,
},
transpilePackages: ["@codegouvfr/react-dsfr", "tss-react"],
};
export default {
...withMDX(withSentryConfig(moduleExports, { silent: true })),
};