2023-12-08 22:35:15 +01:00
|
|
|
// Importing env files here to validate on build
|
2025-01-14 19:03:38 +01:00
|
|
|
import "@homarr/auth/env";
|
|
|
|
|
import "@homarr/db/env";
|
|
|
|
|
import "@homarr/common/env";
|
2025-02-18 22:54:15 +01:00
|
|
|
import "@homarr/log/env";
|
2025-01-22 20:43:54 +01:00
|
|
|
import "@homarr/docker/env";
|
2024-08-29 22:25:51 +02:00
|
|
|
|
2025-01-06 19:59:25 +01:00
|
|
|
import type { NextConfig } from "next";
|
2024-08-29 22:25:51 +02:00
|
|
|
import MillionLint from "@million/lint";
|
2024-10-26 22:46:14 +02:00
|
|
|
import createNextIntlPlugin from "next-intl/plugin";
|
2024-08-29 22:25:51 +02:00
|
|
|
|
2024-10-26 22:46:14 +02:00
|
|
|
// Package path does not work... so we need to use relative path
|
2025-03-12 18:37:43 +01:00
|
|
|
const withNextIntl = createNextIntlPlugin({
|
|
|
|
|
experimental: {
|
|
|
|
|
createMessagesDeclaration: "../../packages/translation/src/lang/en.json",
|
|
|
|
|
},
|
|
|
|
|
requestConfig: "../../packages/translation/src/request.ts",
|
|
|
|
|
});
|
2024-10-26 22:46:14 +02:00
|
|
|
|
2025-01-06 19:59:25 +01:00
|
|
|
interface WebpackConfig {
|
|
|
|
|
module: {
|
|
|
|
|
rules: {
|
|
|
|
|
test: RegExp;
|
|
|
|
|
loader: string;
|
|
|
|
|
}[];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const nextConfig: NextConfig = {
|
2024-03-16 15:51:34 +01:00
|
|
|
output: "standalone",
|
2023-12-08 22:35:15 +01:00
|
|
|
reactStrictMode: true,
|
|
|
|
|
/** We already do linting and typechecking as separate tasks in CI */
|
|
|
|
|
eslint: { ignoreDuringBuilds: true },
|
|
|
|
|
typescript: { ignoreBuildErrors: true },
|
2025-01-06 19:59:25 +01:00
|
|
|
webpack: (config: WebpackConfig, { isServer }) => {
|
2024-07-25 19:52:31 +02:00
|
|
|
if (isServer) {
|
|
|
|
|
config.module.rules.push({
|
|
|
|
|
test: /\.node$/,
|
|
|
|
|
loader: "node-loader",
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-29 21:57:02 +02:00
|
|
|
return config;
|
|
|
|
|
},
|
2023-12-09 00:32:45 +01:00
|
|
|
experimental: {
|
2024-05-19 22:38:39 +02:00
|
|
|
optimizePackageImports: ["@mantine/core", "@mantine/hooks", "@tabler/icons-react"],
|
2023-12-09 00:32:45 +01:00
|
|
|
},
|
2024-05-19 22:38:39 +02:00
|
|
|
transpilePackages: ["@homarr/ui", "@homarr/notifications", "@homarr/modals", "@homarr/spotlight", "@homarr/widgets"],
|
2024-01-02 17:12:26 +01:00
|
|
|
images: {
|
|
|
|
|
domains: ["cdn.jsdelivr.net"],
|
|
|
|
|
},
|
2023-12-08 22:35:15 +01:00
|
|
|
};
|
|
|
|
|
|
2024-08-29 22:25:51 +02:00
|
|
|
// Skip transform is used because of webpack loader, without it for example 'Tooltip.Floating' will not work and show an error
|
2025-01-06 19:59:25 +01:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2024-08-29 22:25:51 +02:00
|
|
|
const withMillionLint = MillionLint.next({ rsc: true, skipTransform: true, telemetry: false });
|
|
|
|
|
|
2024-10-26 22:46:14 +02:00
|
|
|
export default withNextIntl(nextConfig);
|