pollo/next.config.mjs

43 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-04-20 04:20:00 -06:00
// @ts-check
import withPWA from "next-pwa";
/**
* 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,
/**
* If you have the "experimental: { appDir: true }" setting enabled, then you
* must comment the below `i18n` config out.
*
* @see https://github.com/vercel/next.js/issues/41980
*/
i18n: {
locales: ["en"],
defaultLocale: "en",
},
images: {
domains: ["avatars.githubusercontent.com", "lh3.googleusercontent.com"],
},
2023-06-03 01:35:40 -06:00
webpack: (config, { dev, isServer }) => {
if (!dev && !isServer) {
Object.assign(config.resolve.alias, {
"react/jsx-runtime.js": "preact/compat/jsx-runtime",
react: "preact/compat",
"react-dom/test-utils": "preact/test-utils",
"react-dom": "preact/compat",
});
}
return config;
},
2023-04-20 04:20:00 -06:00
};
const nextConfig = withPWA({
dest: "public",
})(config);
export default nextConfig;