Files
Ranjith Raj 6935f6b4e1 Migrate build from Gulp/Browserify to Vite
Replace deprecated Gulp + Browserify + Babel toolchain with Vite:
- package.json: swap gulp/browserify deps for vite, vite-plugin-commonjs, vite-plugin-node-polyfills
- vite.config.js: JSX loader, CommonJS interop with circular require handling, Node polyfills
- Dockerfile/Makefile: node:14 -> node:20, build via vite
- Extract readDirDeep (Node-only) and setupJQueryGlobals into standalone modules
- Add postbuild.js and generateLevelDocs.js as standalone scripts
- Add jasmine.json config and src/style/index.css entry point
- Regenerate yarn.lock for new dependency tree
2026-09-17 15:51:52 +05:30

37 lines
1.2 KiB
Makefile

ifeq ($(OS),Windows_NT)
SHELL := pwsh.exe
else
SHELL := pwsh
endif
.SHELLFLAGS := -NoProfile -Command
REGISTRY_NAME := ghcr.io/
REPOSITORY_NAME := pcottle/
IMAGE_NAME := learngitbranching
TAG := :latest
.PHONY: all clean test
all: build
getcommitid:
$(eval COMMITID = $(shell git log -1 --pretty=format:'%H'))
getbranchname:
$(eval BRANCH_NAME = $(shell (git branch --show-current ) -replace '/','.'))
build:
docker run --rm -v $${PWD}:/mnt --workdir /mnt node:20-alpine yarn install --frozen-lockfile
docker run --rm -v $${PWD}:/mnt --workdir /mnt node:20-alpine yarn build
build_docker: getcommitid getbranchname
docker build -t $(REGISTRY_NAME)$(REPOSITORY_NAME)$(IMAGE_NAME)$(TAG) -t $(REGISTRY_NAME)$(REPOSITORY_NAME)$(IMAGE_NAME):$(BRANCH_NAME) -t $(REGISTRY_NAME)$(REPOSITORY_NAME)$(IMAGE_NAME):$(BRANCH_NAME)_$(COMMITID) .
docker build --target export --output type=local,dest=learnGitBranching_$(BRANCH_NAME)_$(COMMITID) .
run:
docker run -p 8080:80 $(REGISTRY_NAME)$(REPOSITORY_NAME)$(IMAGE_NAME)$(TAG)
clean:
echo 'not implemented'
test: build
docker run --rm -v $${PWD}:/mnt --workdir /mnt node:20-alpine yarn test