diff --git a/frontend/Makefile b/frontend/Makefile index 13570cd..2fca8ad 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -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 diff --git a/frontend/index.html b/frontend/index.html deleted file mode 100644 index 7624f58..0000000 --- a/frontend/index.html +++ /dev/null @@ -1 +0,0 @@ -