diff --git a/Dockerfile b/Dockerfile index 1dc496491..a52519f94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ RUN mkdir -p /var/cache/nginx && \ touch /run/nginx/nginx.pid && \ mkdir -p /etc/nginx/templates /etc/nginx/ssl/certs -COPY --from=builder /app/apps/nextjs/next.config.mjs . +COPY --from=builder /app/apps/nextjs/next.config.ts . COPY --from=builder /app/apps/nextjs/package.json . COPY --from=builder /app/apps/tasks/tasks.cjs ./apps/tasks/tasks.cjs diff --git a/apps/nextjs/next.config.mjs b/apps/nextjs/next.config.ts similarity index 81% rename from apps/nextjs/next.config.mjs rename to apps/nextjs/next.config.ts index bd57eb1a2..5e36315b1 100644 --- a/apps/nextjs/next.config.mjs +++ b/apps/nextjs/next.config.ts @@ -3,6 +3,7 @@ import "@homarr/auth/env.mjs"; import "@homarr/db/env.mjs"; import "@homarr/common/env.mjs"; +import type { NextConfig } from "next"; import MillionLint from "@million/lint"; import createNextIntlPlugin from "next-intl/plugin"; @@ -11,14 +12,22 @@ import "./src/env.mjs"; // Package path does not work... so we need to use relative path const withNextIntl = createNextIntlPlugin("../../packages/translation/src/request.ts"); -/** @type {import("next").NextConfig} */ -const nextConfig = { +interface WebpackConfig { + module: { + rules: { + test: RegExp; + loader: string; + }[]; + }; +} + +const nextConfig: NextConfig = { output: "standalone", reactStrictMode: true, /** We already do linting and typechecking as separate tasks in CI */ eslint: { ignoreDuringBuilds: true }, typescript: { ignoreBuildErrors: true }, - webpack: (config, { isServer }) => { + webpack: (config: WebpackConfig, { isServer }) => { if (isServer) { config.module.rules.push({ test: /\.node$/, @@ -38,6 +47,7 @@ const nextConfig = { }; // Skip transform is used because of webpack loader, without it for example 'Tooltip.Floating' will not work and show an error +// eslint-disable-next-line @typescript-eslint/no-unused-vars const withMillionLint = MillionLint.next({ rsc: true, skipTransform: true, telemetry: false }); export default withNextIntl(nextConfig);