-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (60 loc) · 1.82 KB
/
Makefile
File metadata and controls
71 lines (60 loc) · 1.82 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.PHONY: install dev build preview test-build clean help
# Default target
.DEFAULT_GOAL := help
# Variables
NODE_MODULES := node_modules
DIST := dist
## Install dependencies
install:
@echo "Installing dependencies..."
npm install
@echo "Dependencies installed successfully!"
## Start the development server
dev: start
## Start the development server and open in browser
start:
@echo "Starting development server..."
npm run dev -- --open
## Build for production
build:
@echo "Building for production..."
npm run build
@echo "Build complete! Output in $(DIST)/"
## Preview production build
preview:
@echo "Previewing production build..."
@if [ ! -d "$(DIST)" ]; then \
echo "Error: No build found. Run 'make build' first."; \
exit 1; \
fi
npm run preview
## Test GitHub Actions build locally
test-build:
@echo "Testing GitHub Actions build locally..."
./test-build.sh
## Clean build artifacts and dependencies
clean:
@echo "Cleaning up..."
rm -rf $(DIST)
rm -rf $(NODE_MODULES)
@echo "Cleanup complete."
## Show help message
help:
@echo "Personal Website Makefile"
@echo ""
@echo "Available targets:"
@echo " install - Install npm dependencies"
@echo " dev - Start development server (alias for start)"
@echo " start - Start development server and open in browser"
@echo " build - Build for production"
@echo " preview - Preview production build"
@echo " test-build - Test GitHub Actions build locally"
@echo " clean - Remove build artifacts and node_modules"
@echo " help - Show this help message"
@echo ""
@echo "Examples:"
@echo " make install - Install dependencies"
@echo " make start - Start dev server"
@echo " make build - Build for production"
@echo " make preview - Preview production build"
@echo " make test-build - Test GitHub Actions build locally"