forked from dangduyminh109/algorithm-design-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
55 lines (48 loc) · 1.17 KB
/
build.bat
File metadata and controls
55 lines (48 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@echo off
echo Starting optimized build process...
REM Clean previous builds
echo Cleaning previous builds...
if exist .next rmdir /s /q .next
if exist out rmdir /s /q out
if exist node_modules\.cache rmdir /s /q node_modules\.cache
REM Install dependencies with cache optimization
echo Installing dependencies...
call npm ci --prefer-offline --no-audit
if %errorlevel% neq 0 (
echo Failed to install dependencies!
exit /b %errorlevel%
)
REM Check for TypeScript errors
echo Checking TypeScript...
call npx tsc --noEmit
if %errorlevel% neq 0 (
echo TypeScript check failed!
exit /b %errorlevel%
)
REM Lint code
echo Linting code...
call npm run lint
if %errorlevel% neq 0 (
echo Linting failed!
exit /b %errorlevel%
)
REM Build with optimizations
echo Building with optimizations...
set NODE_ENV=production
call npm run build
if %errorlevel% neq 0 (
echo Build failed!
exit /b %errorlevel%
)
REM Analyze bundle size
echo Analyzing bundle size...
if exist .next (
echo Build completed successfully!
echo Checking bundle size...
dir .next\static\chunks\*.js /s
) else (
echo Build failed!
exit /b 1
)
echo Build optimization completed!
pause