XiaoBai1221 Claude commited on
Commit
49f42a7
·
1 Parent(s): 277929e

Fix: Add missing lib/utils.ts and Turbopack config

Browse files

- Force add lib/utils.ts (was ignored by parent .gitignore)
- Add turbopack.resolveAlias in next.config.mjs for path resolution
- Simplify Dockerfile build steps

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Dockerfile CHANGED
@@ -44,13 +44,8 @@ COPY . .
44
 
45
  # Build Next.js 前端
46
  RUN cd bloom-ware-login \
47
- && echo "=== 檢查檔案結構 ===" \
48
- && ls -la lib/ \
49
- && echo "=== 檢查 tsconfig.json ===" \
50
- && cat tsconfig.json | grep -A 5 "paths" \
51
  && npm install --legacy-peer-deps \
52
- && echo "=== 使用 webpack 建置(禁用 Turbopack) ===" \
53
- && NEXT_USE_TURBOPACK=0 npm run build \
54
  && cd ..
55
 
56
  ENV PORT=7860
 
44
 
45
  # Build Next.js 前端
46
  RUN cd bloom-ware-login \
 
 
 
 
47
  && npm install --legacy-peer-deps \
48
+ && npm run build \
 
49
  && cd ..
50
 
51
  ENV PORT=7860
bloom-ware-login/lib/utils.ts ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ import { clsx, type ClassValue } from 'clsx'
2
+ import { twMerge } from 'tailwind-merge'
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs))
6
+ }
bloom-ware-login/next.config.mjs CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  /** @type {import('next').NextConfig} */
2
  const nextConfig = {
3
  typescript: {
@@ -10,6 +16,11 @@ const nextConfig = {
10
  basePath: '/login', // 所有靜態資源路徑加上 /login 前綴
11
  distDir: 'out',
12
  trailingSlash: true,
 
 
 
 
 
13
  }
14
 
15
  export default nextConfig
 
1
+ import path from 'path'
2
+ import { fileURLToPath } from 'url'
3
+
4
+ const __filename = fileURLToPath(import.meta.url)
5
+ const __dirname = path.dirname(__filename)
6
+
7
  /** @type {import('next').NextConfig} */
8
  const nextConfig = {
9
  typescript: {
 
16
  basePath: '/login', // 所有靜態資源路徑加上 /login 前綴
17
  distDir: 'out',
18
  trailingSlash: true,
19
+ turbopack: {
20
+ resolveAlias: {
21
+ '@': __dirname,
22
+ },
23
+ },
24
  }
25
 
26
  export default nextConfig