cherry-studio/packages/catalog/web/next.config.ts
suyao 67f726afb7
feat: implement API client with SWR integration for catalog management
- Added a new Textarea component for user input.
- Configured ESLint with custom rules and global ignores.
- Developed a comprehensive API client with CRUD operations and error handling.
- Defined catalog types and schemas using Zod for type safety.
- Created utility functions for class name merging and validation.
- Established Next.js configuration for API rewrites and static file headers.
- Set up package.json with necessary dependencies and scripts.
- Configured PostCSS for Tailwind CSS integration.
- Added SVG assets for UI components.
- Configured TypeScript with strict settings and module resolution.
2025-12-01 13:07:23 +08:00

41 lines
952 B
TypeScript

import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
// Configure static file serving from external directory
async rewrites() {
return [
// Proxy API requests to the catalog API
{
source: '/api/catalog/:path*',
destination: 'http://localhost:3001/api/catalog/:path*'
}
]
},
// Add custom headers for static files
async headers() {
return [
{
source: '/data/:path*',
headers: [
{
key: 'Cache-Control',
value: 'public, max-age=3600, must-revalidate'
},
{
key: 'Access-Control-Allow-Origin',
value: '*'
}
]
}
]
},
// Configure serving static files from outside public directory
outputFileTracingExcludes: {
'*': ['./**/__tests__/**/*']
},
// Basic Turbopack configuration to silence warning
turbopack: {}
}
export default nextConfig