add Makefile
This commit is contained in:
28
Makefile
Normal file
28
Makefile
Normal file
@ -0,0 +1,28 @@
|
||||
# Define variables for commands to keep it simple and centralized
|
||||
NPM := npm
|
||||
BUILD_DIR := dist
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default: build
|
||||
|
||||
# Target for installing dependencies
|
||||
install_deps:
|
||||
@echo "Installing project dependencies..."
|
||||
@$(NPM) install
|
||||
|
||||
# Target for building the project
|
||||
build: install_deps
|
||||
@echo "Building the project..."
|
||||
@$(NPM) run build
|
||||
@$(MAKE) banner
|
||||
|
||||
# Target for printing a completion banner with colors
|
||||
banner:
|
||||
@echo -e "\033[1;36m================================================================================\033[0m"
|
||||
@echo -e "\033[1;32m BUILD COMPLETED SUCCESSFULLY 🎉\033[0m"
|
||||
@echo -e "\033[1;33m The $(BUILD_DIR) directory is ready to be served as a webroot.\033[0m"
|
||||
@echo -e "\033[1;36m================================================================================\033[0m"
|
||||
|
||||
|
||||
# Phony targets are not files
|
||||
.PHONY: install_deps build banner
|
||||
Reference in New Issue
Block a user