SurfSense/surfsense_web/next.config.ts
DESKTOP-RTLN3BA\$punk 47b2994ec7
Some checks are pending
Build and Push Docker Images / tag_release (push) Waiting to run
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_backend, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64) (push) Blocked by required conditions
Build and Push Docker Images / build (./surfsense_web, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (backend, surfsense-backend) (push) Blocked by required conditions
Build and Push Docker Images / create_manifest (web, surfsense-web) (push) Blocked by required conditions
feat: fixed vision/image provider specific errors and fixed podcast/video streaming
2026-05-02 19:18:53 -07:00

83 lines
2 KiB
TypeScript

import path from "node:path";
import { createMDX } from "fumadocs-mdx/next";
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
// Create the next-intl plugin
const withNextIntl = createNextIntlPlugin("./i18n/request.ts");
// 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.
const nextConfig: NextConfig = {
output: "standalone",
outputFileTracingRoot: path.join(__dirname, ".."),
reactStrictMode: false,
typescript: {
ignoreBuildErrors: true,
},
images: {
remotePatterns: [
{
protocol: "http",
hostname: "localhost",
port: "8000",
pathname: "/api/v1/image-generations/**",
},
{
protocol: "https",
hostname: "**",
},
],
},
experimental: {
optimizePackageImports: [
"lucide-react",
"@tabler/icons-react",
"date-fns",
"@assistant-ui/react",
"@assistant-ui/react-markdown",
"motion",
],
},
// Turbopack config (used during `next dev --turbopack`)
turbopack: {
rules: {
"*.svg": {
loaders: ["@svgr/webpack"],
as: "*.js",
},
},
},
// Configure webpack (SVGR)
webpack: (config) => {
// SVGR: import *.svg as React components
const fileLoaderRule = config.module.rules.find(
(rule: { test?: { test?: (s: string) => boolean } }) => rule.test?.test?.(".svg")
);
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"],
}
);
fileLoaderRule.exclude = /\.svg$/i;
return config;
},
};
// Wrap the config with MDX and next-intl plugins
const withMDX = createMDX({});
export default withNextIntl(withMDX(nextConfig));