2025-07-27 10:05:37 -07:00
|
|
|
import { createMDX } from "fumadocs-mdx/next";
|
2025-07-27 10:54:25 -07:00
|
|
|
import type { NextConfig } from "next";
|
2025-10-27 20:30:10 -07:00
|
|
|
import createNextIntlPlugin from "next-intl/plugin";
|
2026-03-21 13:20:13 +05:30
|
|
|
import path from "path";
|
feat(i18n): Add next-intl framework with full bilingual support (EN/ZH)
- Implement next-intl framework for scalable i18n
- Add complete Chinese (Simplified) localization
- Support 400+ translated strings across all pages
- Add language switcher with persistent preference
- Zero breaking changes to existing functionality
Framework additions:
- i18n routing and middleware
- LocaleContext for client-side state
- LanguageSwitcher component
- Translation files (en.json, zh.json)
Translated components:
- Homepage: Hero, features, CTA, navbar
- Auth: Login, register
- Dashboard: Main page, layout
- Connectors: Management, add page (all categories)
- Documents: Upload, manage, filters
- Settings: LLM configs, role assignments
- Onboarding: Add provider, assign roles
- Logs: Task logs viewer
Adding a new language now requires only:
1. Create messages/<locale>.json
2. Add locale to i18n/routing.ts
2025-10-26 14:05:46 +08:00
|
|
|
|
|
|
|
|
// Create the next-intl plugin
|
2025-10-27 20:30:10 -07:00
|
|
|
const withNextIntl = createNextIntlPlugin("./i18n/request.ts");
|
2025-04-07 23:47:06 -07:00
|
|
|
|
2026-03-17 17:32:28 +02:00
|
|
|
// TODO: Separate app routes (/login, /dashboard) from marketing routes
|
|
|
|
|
// (landing page, /contact, /pricing, /docs) so the desktop build only
|
|
|
|
|
// ships what desktop users actually need.
|
2025-04-07 23:47:06 -07:00
|
|
|
const nextConfig: NextConfig = {
|
2025-10-23 20:37:01 -07:00
|
|
|
output: "standalone",
|
2026-03-17 19:28:27 +02:00
|
|
|
outputFileTracingRoot: path.join(__dirname, ".."),
|
2025-11-23 15:23:31 +05:30
|
|
|
reactStrictMode: false,
|
2025-07-27 10:05:37 -07:00
|
|
|
typescript: {
|
|
|
|
|
ignoreBuildErrors: true,
|
|
|
|
|
},
|
2025-07-27 10:54:25 -07:00
|
|
|
images: {
|
|
|
|
|
remotePatterns: [
|
|
|
|
|
{
|
|
|
|
|
protocol: "https",
|
2025-08-23 19:40:29 -07:00
|
|
|
hostname: "**",
|
2025-07-27 13:45:58 -07:00
|
|
|
},
|
2025-07-27 10:54:25 -07:00
|
|
|
],
|
|
|
|
|
},
|
2026-02-10 16:23:12 +05:30
|
|
|
// Turbopack config (used during `next dev --turbopack`)
|
|
|
|
|
turbopack: {
|
|
|
|
|
rules: {
|
|
|
|
|
"*.svg": {
|
|
|
|
|
loaders: ["@svgr/webpack"],
|
|
|
|
|
as: "*.js",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
2026-02-17 11:34:11 +05:30
|
|
|
// Configure webpack (SVGR)
|
|
|
|
|
webpack: (config) => {
|
2026-02-10 16:23:12 +05:30
|
|
|
// SVGR: import *.svg as React components
|
2026-02-10 19:06:21 +05:30
|
|
|
const fileLoaderRule = config.module.rules.find((rule: any) => rule.test?.test?.(".svg"));
|
2026-02-10 16:23:12 +05:30
|
|
|
config.module.rules.push(
|
|
|
|
|
// Re-apply the existing file loader for *.svg?url imports
|
|
|
|
|
{
|
|
|
|
|
...fileLoaderRule,
|
|
|
|
|
test: /\.svg$/i,
|
|
|
|
|
resourceQuery: /url/, // e.g. import icon from './icon.svg?url'
|
|
|
|
|
},
|
|
|
|
|
// Convert all other *.svg imports to React components
|
|
|
|
|
{
|
|
|
|
|
test: /\.svg$/i,
|
|
|
|
|
issuer: fileLoaderRule.issuer,
|
|
|
|
|
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] },
|
|
|
|
|
use: ["@svgr/webpack"],
|
2026-02-10 19:06:21 +05:30
|
|
|
}
|
2026-02-10 16:23:12 +05:30
|
|
|
);
|
|
|
|
|
fileLoaderRule.exclude = /\.svg$/i;
|
|
|
|
|
|
2025-11-23 15:23:31 +05:30
|
|
|
return config;
|
|
|
|
|
},
|
2025-04-07 23:47:06 -07:00
|
|
|
};
|
|
|
|
|
|
feat(i18n): Add next-intl framework with full bilingual support (EN/ZH)
- Implement next-intl framework for scalable i18n
- Add complete Chinese (Simplified) localization
- Support 400+ translated strings across all pages
- Add language switcher with persistent preference
- Zero breaking changes to existing functionality
Framework additions:
- i18n routing and middleware
- LocaleContext for client-side state
- LanguageSwitcher component
- Translation files (en.json, zh.json)
Translated components:
- Homepage: Hero, features, CTA, navbar
- Auth: Login, register
- Dashboard: Main page, layout
- Connectors: Management, add page (all categories)
- Documents: Upload, manage, filters
- Settings: LLM configs, role assignments
- Onboarding: Add provider, assign roles
- Logs: Task logs viewer
Adding a new language now requires only:
1. Create messages/<locale>.json
2. Add locale to i18n/routing.ts
2025-10-26 14:05:46 +08:00
|
|
|
// Wrap the config with MDX and next-intl plugins
|
2025-04-22 02:24:13 -07:00
|
|
|
const withMDX = createMDX({});
|
|
|
|
|
|
feat(i18n): Add next-intl framework with full bilingual support (EN/ZH)
- Implement next-intl framework for scalable i18n
- Add complete Chinese (Simplified) localization
- Support 400+ translated strings across all pages
- Add language switcher with persistent preference
- Zero breaking changes to existing functionality
Framework additions:
- i18n routing and middleware
- LocaleContext for client-side state
- LanguageSwitcher component
- Translation files (en.json, zh.json)
Translated components:
- Homepage: Hero, features, CTA, navbar
- Auth: Login, register
- Dashboard: Main page, layout
- Connectors: Management, add page (all categories)
- Documents: Upload, manage, filters
- Settings: LLM configs, role assignments
- Onboarding: Add provider, assign roles
- Logs: Task logs viewer
Adding a new language now requires only:
1. Create messages/<locale>.json
2. Add locale to i18n/routing.ts
2025-10-26 14:05:46 +08:00
|
|
|
export default withNextIntl(withMDX(nextConfig));
|