This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
Lateinicus/frontend/Makefile

29 lines
577 B
Makefile
Raw Normal View History

2018-09-20 16:44:46 +00:00
dist/minified:
mkdir -p dist/minified
UGLIFYJS := ./node_modules/.bin/uglifyjs
# $1: The file to minify
define minify
$(shell ${UGLIFYJS} --mangle --compress -o "./dist/minified/$(notdir $1)" -- $1)
endef
node_modules:
npm install
.PHONY: watch
watch: node_modules
npm start
.PHONY: build
build: node_modules dist/minified
@echo Building with parcel
2018-09-28 21:33:28 +00:00
./node_modules/.bin/parcel build --out-dir dist/app src/index.html
2018-09-20 16:44:46 +00:00
@echo Minifying
$(foreach file, $(wildcard dist/*.js), $(call minify, $(file)))
$(shell ls -lah ./dist/minified)
2018-09-20 16:50:15 +00:00
.PHONY: watch
watch:
npm start