35 lines
1.0 KiB
Makefile
35 lines
1.0 KiB
Makefile
node_modules:
|
|
npm install
|
|
|
|
.PHONY: watch
|
|
watch: node_modules
|
|
npm start
|
|
|
|
clean:
|
|
rm -rf dist/
|
|
rm -f sha512sums
|
|
|
|
.PHONY: build
|
|
build: prod
|
|
prod: node_modules clean
|
|
@echo Building with parcel
|
|
NODE_DEV=production ./node_modules/.bin/parcel build --out-dir dist/app src/index.hbs
|
|
./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 Generate checksums
|
|
find ./dist/ -exec sha512sum {} + | awk -F \. '{ if($$4 != "map") print $$0}' | awk -F \/ '{ if($$3 == "lost.html") {} else if ($$3 == "error.html") {} else print $$0}' > sha512sums
|
|
|
|
@echo Creating tarball
|
|
tar -czf lateinicus-web.tar.gz dist/
|
|
|
|
dev: node_modules clean
|
|
@echo Building with parcel
|
|
NODE_ENV=development ./node_modules/.bin/parcel build --out-dir dist/app src/index.hbs
|
|
./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
|