-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathnext.config.mjs
More file actions
47 lines (41 loc) · 1.46 KB
/
next.config.mjs
File metadata and controls
47 lines (41 loc) · 1.46 KB
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
/** @type {import('next').NextConfig} */
import path from "path";
import { fileURLToPath } from "url";
import createMDX from "@next/mdx";
// Get __dirname equivalent in ES modules
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const nextConfig = {
sassOptions: {
implementation: "sass-embedded",
includePaths: [
path.join(__dirname, "./", "node_modules", "@uswds", "uswds", "packages"),
],
silenceDeprecations: ["global-builtin", "legacy-js-api", "if-function"],
},
transpilePackages: ["yaml"],
serverExternalPackages: ["@aws-sdk/client-secrets-manager"],
output: "standalone",
basePath: "",
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
};
const withMDX = createMDX({
extension: /\.(md|mdx)$/,
options: {
// Turbopack doesn't seem to play nice with Remark plugins
remarkPlugins: [],
rehypePlugins: [],
},
});
// uncomment this in order to run the Next trace package by
// 1. running dev with NEXT_TURBOPACK_TRACING=1 npm run dev
// 2. clicking around the problematic pages
// 3. in a separate terminal, running next internal turbo-trace-server .next/trace-turbopack
// and opening the generated file at trace.nextjs.org
// import createBundleAnalyzer from "@next/mdx";
// const withBundleAnalyzer = createBundleAnalyzer({
// enabled: process.env.ANALYZE === "true",
// });
//
// export default withBundleAnalyzer(withMDX(nextConfig));
export default withMDX(nextConfig);