<commit_before>.PHONY: clean docker-image webpack

PROJECT:=webapp
BUILD_DIR:=${PROJECT}/build
DOCKER_WORKDIR:=/usr/local/${PROJECT}

clean:
	rm -rf "${BUILD_DIR}" "${PROJECT}"/node_modules

docker-image: ${BUILD_DIR}/docker_image

${BUILD_DIR}/docker_image: Dockerfile ${PROJECT}/package.json | ${BUILD_DIR}
	docker build -t abstiles/${PROJECT} --rm .
	docker images -q abstiles/${PROJECT} > "$@"

${BUILD_DIR}:
	mkdir ${BUILD_DIR}

webpack: ${BUILD_DIR}/index.html

${BUILD_DIR}/index.html: docker-image ${PROJECT}/src/*
	docker run -it --rm \
		-v "$(abspath ${PROJECT}):${DOCKER_WORKDIR}/project:Z" \
		-w ${DOCKER_WORKDIR}/project \
		abstiles/${PROJECT} \
		webpack<commit_msg>Fix Makefile always rebuilding index.html<commit_after>.PHONY: clean docker-image webpack

PROJECT:=webapp
BUILD_DIR:=${PROJECT}/build
DOCKER_WORKDIR:=/usr/local/${PROJECT}

clean:
	rm -rf "${BUILD_DIR}" "${PROJECT}"/node_modules

docker-image: ${BUILD_DIR}/docker_image

${BUILD_DIR}/docker_image: Dockerfile ${PROJECT}/package.json | ${BUILD_DIR}
	docker build -t abstiles/${PROJECT} --rm .
	docker images -q abstiles/${PROJECT} > "$@"

${BUILD_DIR}:
	mkdir ${BUILD_DIR}

webpack: ${BUILD_DIR}/index.html

${BUILD_DIR}/index.html: ${BUILD_DIR}/docker_image ${PROJECT}/src/*
	docker run -it --rm \
		-v "$(abspath ${PROJECT}):${DOCKER_WORKDIR}/project:Z" \
		-w ${DOCKER_WORKDIR}/project \
		abstiles/${PROJECT} \
		webpack
{'fraction_non_alphanumeric': 0.18763326226012794, 'fraction_numerical': 0.0, 'mean_word_length': 5.121739130434783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2285432', 'n_tokens_mistral': 558, 'n_tokens_neox': 524, 'n_words': 95}