Created
February 29, 2024 10:25
-
-
Save aidenybai/5a8ce4f4cc7f3332fcc77b73261d4132 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 `next.config.js`: | |
| ```js | |
| import withBundleAnalyzer from "@next/bundle-analyzer"; | |
| // @ts-check | |
| /** | |
| * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. | |
| * This is especially useful for Docker builds. | |
| */ | |
| !process.env.SKIP_ENV_VALIDATION && (await import("./src/env.mjs")); | |
| /** @type {import("next").NextConfig} */ | |
| const config = { | |
| // reactStrictMode: true, | |
| i18n: { | |
| locales: ["en"], | |
| defaultLocale: "en", | |
| }, | |
| images: { | |
| dangerouslyAllowSVG: true, | |
| remotePatterns: [ | |
| { | |
| protocol: "https", | |
| hostname: "api.iconify.design", | |
| }, | |
| { | |
| protocol: "https", | |
| hostname: "avatar.vercel.sh", | |
| }, | |
| { | |
| protocol: "https", | |
| hostname: "source.boringavatars.com", | |
| }, | |
| ], | |
| }, | |
| async rewrites() { | |
| return [ | |
| /* Rewrite of Infra API */ | |
| { | |
| source: "/infra/:path*", | |
| destination: "https://infra.rocetta.com/:path*", | |
| }, | |
| { | |
| source: "/hoggy/:path*", | |
| destination: "https://app.posthog.com/:path*", | |
| }, | |
| ]; | |
| }, | |
| }; | |
| export default withBundleAnalyzer({ | |
| enabled: process.env.ANALYZE === "true", | |
| })(config); | |
| ``` | |
| Add the `MillionLint` Next.js plugin, this is a reference for you to apply to the original next.config.js. Only output code. | |
| ```jsx | |
| import MillionLint from '@million/lint'; | |
| const nextConfig = { | |
| reactStrictMode: true, | |
| }; | |
| export default MillionLint.next(nextConfig); | |
| ``` | |
| ``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment