feat: Error pages + Makefile improvements

Error pages: Add error pages for 404 and 50X errors by nginx
Makefile improvements: Remove shit.sh and replace it by improving the
Makefile
This commit is contained in:
Alexander Polynomdivision
2018-10-03 20:24:06 +02:00
parent f836145981
commit 082f254da0
6 changed files with 58 additions and 17 deletions

View File

@@ -1,12 +1,3 @@
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
@@ -14,15 +5,25 @@ node_modules:
watch: node_modules
npm start
clean:
rm -rf dist/
.PHONY: build
build: node_modules dist/minified
build: prod
prod: node_modules clean
@echo Building with parcel
./node_modules/.bin/parcel build --out-dir dist/app src/index.html
./node_modules/.bin/parcel build --out-dir dist src/lost.html src/error.html
sed -e "s/\/src/\/app\/src/g" --in-place dist/app/index.html
@echo Minifying
$(foreach file, $(wildcard dist/*.js), $(call minify, $(file)))
$(shell ls -lah ./dist/minified)
tar -czf lateinicus-web.tar.gz dist/
.PHONY: watch
watch:
npm start
dev: node_modules clean
@echo Building with parcel
./node_modules/.bin/parcel build --out-dir dist/app src/index.html
./node_modules/.bin/parcel build --out-dir dist src/lost.html src/error.html
sed -e "s/\/src/\/app\/src/g" --in-place dist/app/index.html
chmod 604 -R dist/app/*
chmod 604 dist/error.html dist/lost.html
chmod 705 dist dist/app