mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-30 11:19:12 +01:00
* fix(deps): update dependency next-intl to v4 * fix: typecheck issue * refactor: implement improvements for next-intl v4 * fix: typecheck issues * fix: typecheck issue --------- Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com> Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
// Importing env files here to validate on build
|
|
import "@homarr/auth/env";
|
|
import "@homarr/db/env";
|
|
import "@homarr/common/env";
|
|
import "@homarr/log/env";
|
|
import "@homarr/docker/env";
|
|
|
|
import type { NextConfig } from "next";
|
|
import MillionLint from "@million/lint";
|
|
import createNextIntlPlugin from "next-intl/plugin";
|
|
|
|
// Package path does not work... so we need to use relative path
|
|
const withNextIntl = createNextIntlPlugin({
|
|
experimental: {
|
|
createMessagesDeclaration: "../../packages/translation/src/lang/en.json",
|
|
},
|
|
requestConfig: "../../packages/translation/src/request.ts",
|
|
});
|
|
|
|
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: WebpackConfig, { isServer }) => {
|
|
if (isServer) {
|
|
config.module.rules.push({
|
|
test: /\.node$/,
|
|
loader: "node-loader",
|
|
});
|
|
}
|
|
|
|
return config;
|
|
},
|
|
experimental: {
|
|
optimizePackageImports: ["@mantine/core", "@mantine/hooks", "@tabler/icons-react"],
|
|
},
|
|
transpilePackages: ["@homarr/ui", "@homarr/notifications", "@homarr/modals", "@homarr/spotlight", "@homarr/widgets"],
|
|
images: {
|
|
domains: ["cdn.jsdelivr.net"],
|
|
},
|
|
};
|
|
|
|
// 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);
|