mirror of
https://github.com/codeaashu/claude-code.git
synced 2026-04-08 22:28:48 +03:00
claude-code
This commit is contained in:
71
web/next.config.ts
Normal file
71
web/next.config.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { NextConfig } from "next";
|
||||
import bundleAnalyzer from "@next/bundle-analyzer";
|
||||
|
||||
const withBundleAnalyzer = bundleAnalyzer({
|
||||
enabled: process.env.ANALYZE === "true",
|
||||
});
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
reactStrictMode: true,
|
||||
experimental: {
|
||||
typedRoutes: true,
|
||||
optimizePackageImports: ["lucide-react", "@radix-ui/react-dialog", "@radix-ui/react-dropdown-menu", "@radix-ui/react-tooltip"],
|
||||
},
|
||||
|
||||
// Compress responses
|
||||
compress: true,
|
||||
|
||||
// Image optimization
|
||||
images: {
|
||||
formats: ["image/avif", "image/webp"],
|
||||
minimumCacheTTL: 60,
|
||||
},
|
||||
|
||||
// Static asset caching headers
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: "/_next/static/:path*",
|
||||
headers: [
|
||||
{ key: "Cache-Control", value: "public, max-age=31536000, immutable" },
|
||||
],
|
||||
},
|
||||
{
|
||||
source: "/fonts/:path*",
|
||||
headers: [
|
||||
{ key: "Cache-Control", value: "public, max-age=31536000, immutable" },
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
webpack(config, { isServer }) {
|
||||
// Web Worker support
|
||||
config.module.rules.push({
|
||||
test: /\.worker\.(ts|js)$/,
|
||||
use: [
|
||||
{
|
||||
loader: "worker-loader",
|
||||
options: {
|
||||
filename: "static/workers/[name].[contenthash].js",
|
||||
publicPath: "/_next/",
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// Ignore node-specific modules in browser bundle
|
||||
if (!isServer) {
|
||||
config.resolve.fallback = {
|
||||
...config.resolve.fallback,
|
||||
fs: false,
|
||||
path: false,
|
||||
os: false,
|
||||
};
|
||||
}
|
||||
|
||||
return config;
|
||||
},
|
||||
};
|
||||
|
||||
export default withBundleAnalyzer(nextConfig);
|
||||
Reference in New Issue
Block a user