Files
WooNooW/customer-spa/vite.config.ts
dwindown 342104eeab feat: Initialize customer-spa project structure
Sprint 1 - Foundation Setup:

Created customer-spa/ folder structure:
```
customer-spa/
├── src/
│   ├── pages/          # Customer pages (Shop, Cart, Checkout, Account)
│   ├── components/     # Reusable components
│   ├── lib/
│   │   ├── api/        # API client
│   │   ├── cart/       # Cart state management
│   │   ├── checkout/   # Checkout logic
│   │   └── tracking/   # Analytics & pixel tracking
│   ├── hooks/          # Custom React hooks
│   ├── contexts/       # React contexts
│   └── types/          # TypeScript types
├── public/             # Static assets
├── package.json        # Dependencies
├── vite.config.ts      # Vite configuration (port 5174)
├── tsconfig.json       # TypeScript configuration
├── tailwind.config.js  # TailwindCSS configuration
├── postcss.config.js   # PostCSS configuration
└── .eslintrc.cjs       # ESLint configuration
```

Configuration:
 Vite dev server on port 5174 (admin-spa uses 5173)
 HTTPS with shared SSL cert
 TypeScript + React 18
 TailwindCSS + shadcn/ui
 React Query for data fetching
 Zustand for state management
 React Hook Form + Zod for forms
 React Router for routing

Dependencies Added:
- Core: React 18, React DOM, React Router
- UI: Radix UI components, Lucide icons
- State: Zustand, TanStack Query
- Forms: React Hook Form, Zod, @hookform/resolvers
- Styling: TailwindCSS, class-variance-authority
- Utils: clsx, tailwind-merge, sonner (toast)

Next Steps:
- Create main.tsx entry point
- Create App.tsx with routing
- Create base layout components
- Setup API client
- Implement cart state management

Ready for Sprint 1 implementation!
2025-11-21 13:05:04 +07:00

30 lines
881 B
TypeScript

import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import fs from 'node:fs';
import path from 'node:path';
const key = fs.readFileSync(path.resolve(__dirname, '../admin-spa/.cert/woonoow.local-key.pem'));
const cert = fs.readFileSync(path.resolve(__dirname, '../admin-spa/.cert/woonoow.local-cert.pem'));
export default defineConfig({
plugins: [react()],
resolve: { alias: { '@': path.resolve(__dirname, './src') } },
server: {
host: 'woonoow.local',
port: 5174,
strictPort: true,
https: { key, cert },
cors: true,
origin: 'https://woonoow.local:5174',
hmr: { protocol: 'wss', host: 'woonoow.local', port: 5174 }
},
build: {
outDir: 'dist',
emptyOutDir: true,
rollupOptions: {
input: { app: 'src/main.tsx' },
output: { entryFileNames: 'app.js', assetFileNames: 'app.[ext]' }
}
}
});