-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
271 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
addons/scripts/reliverse/relicon/setup/configs/next.config.clean.ts
This file was deleted.
Oops, something went wrong.
125 changes: 50 additions & 75 deletions
125
addons/scripts/reliverse/relicon/setup/configs/next.config.minimal.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,73 @@ | ||
// Everything starts here. This is the main Next.js configuration file. | ||
// The Reliverse Next Config comes with minimal and recommended configurations. | ||
// Run `pnpm reli:setup` to easily switch between them and set up other | ||
// tools. If you want to try all new Next.js features and | ||
// Million.js, choose the recommended configuration. | ||
// P.S. The *.mjs extension is not needed anymore | ||
// because the package.json type module is used. | ||
|
||
import createMDX from "@next/mdx"; | ||
import createNextIntlPlugin from "next-intl/plugin"; | ||
import remarkGfm from "remark-gfm"; | ||
|
||
// The Reliverse Next Config comes with minimal and recommended configurations. | ||
// Run `pnpm reli:setup` to easily switch between them and set up other tools. | ||
// If you want to try all new Next.js features and Million.js, choose the recommended configuration. | ||
// P.S. The *.mjs extension is no longer necessary because the package.json type module is used. | ||
await import("~/env.js"); | ||
|
||
// Uncomment the following lines to enable the Vercel Toolbar (and <Reliverse /> component in RootLocaleLayout) | ||
// import withVercelToolbar from "@vercel/toolbar/plugins/next"; | ||
// | ||
// The whitelist list of domains that are allowed to show media content | ||
|
||
const hostnames = [ | ||
"*.githubusercontent.com", | ||
"*.googleusercontent.com", | ||
"api.dicebear.com", | ||
"cdn.discordapp.com", | ||
"discordapp.com", | ||
"githubusercontent.com", | ||
"googleusercontent.com", | ||
"i.imgur.com", | ||
"images.unsplash.com", | ||
"img.youtube.com", | ||
"pbs.twimg.com", | ||
"res.cloudinary.com", | ||
"utfs.io", | ||
"www.gravatar.com", | ||
"img.clerk.com", | ||
"images.clerk.com", | ||
]; | ||
|
||
// @see https://nextjs.org/docs/app/building-the-application/configuring | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
experimental: { | ||
// React Compiler currently uses Webpack/Babel only, so it may slightly slow down the build | ||
// reactCompiler: false, | ||
mdxRs: true, | ||
optimizePackageImports: ["lucide-react", "@radix-ui/react-icons"], | ||
ppr: false, // true - supported by next@canary only | ||
// uncomment if you use superjson in 'browser' context | ||
// swcPlugins: [ | ||
// [ | ||
// "next-superjson-plugin", | ||
// { | ||
// excluded: [], | ||
// }, | ||
// ], | ||
// ], | ||
}, | ||
images: { | ||
formats: ["image/avif", "image/webp"], | ||
remotePatterns: hostnames.map((hostname) => ({ | ||
hostname, | ||
protocol: "https", | ||
})), | ||
remotePatterns: [ | ||
{ | ||
port: "", | ||
protocol: "https", | ||
hostname: "utfs.io", | ||
}, | ||
{ | ||
port: "", | ||
protocol: "https", | ||
hostname: "img.clerk.com", | ||
}, | ||
{ | ||
port: "", | ||
protocol: "https", | ||
hostname: "api.dicebear.com", | ||
}, | ||
{ | ||
port: "", | ||
protocol: "https", | ||
hostname: "cdn.discordapp.com", | ||
}, | ||
{ | ||
port: "", | ||
protocol: "https", | ||
hostname: "lh3.googleusercontent.com", | ||
}, | ||
{ | ||
port: "", | ||
protocol: "https", | ||
hostname: "avatars.githubusercontent.com", | ||
}, | ||
], | ||
}, | ||
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], | ||
|
||
// Adobe React Spectrum (next dev --turbo is not supported) | ||
// transpilePackages: [ | ||
// "@adobe/react-spectrum", | ||
// "@react-spectrum/*", | ||
// "@spectrum-icons/*", | ||
// ].flatMap((spec) => glob.sync(spec, { cwd: "node_modules/" })), | ||
experimental: { | ||
mdxRs: true, | ||
optimizePackageImports: [ | ||
"recharts", | ||
"lucide-react", | ||
"@radix-ui/react-icons", | ||
"@radix-ui/react-avatar", | ||
"@radix-ui/react-select", | ||
], | ||
}, | ||
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], | ||
}; | ||
|
||
// Create a config wrapper required to integrate a modern Next.js MDX support | ||
// @see https://nextjs.org/docs/app/building-the-application/configuring/mdx | ||
const withMDX = createMDX({ | ||
// extension: /\.mdx?$/, | ||
options: { | ||
rehypePlugins: [], | ||
remarkPlugins: [remarkGfm], | ||
}, | ||
}); | ||
|
||
// Create a configuration wrapper required to change the default next-intl config location | ||
// @see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing | ||
const withIntl = createNextIntlPlugin("./src/i18n.ts"); | ||
|
||
// Uncomment the following lines to enable the Vercel Toolbar (and <Reliverse /> component in RootLocaleLayout) | ||
// | ||
// const reliverseConfig = withIntl(withMDX(nextConfig)); | ||
// const reliverseConfigWithVercelToolbar = withVercelToolbar()(reliverseConfig); | ||
// Export the chained config | ||
// export default process.env.ENABLE_VERCEL_TOOLBAR | ||
// ? reliverseConfigWithVercelToolbar | ||
// : reliverseConfig; | ||
// @ts-expect-error TODO: fix | ||
export default withIntl(withMDX(nextConfig)); | ||
const chainedNextConfig = withIntl(withMDX(nextConfig)); | ||
|
||
export default chainedNextConfig; |
Oops, something went wrong.