Verified Commit e09e7d54 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

Add svgcleaner step for svg minification

Reduce the size of the svg on build with ~ 50% by using svgcleaner.
parent d569d645
Pipeline #2637 passed with stage
in 37 seconds
......@@ -2,7 +2,7 @@ image: "archlinux:latest"
dist:
script:
- pacman -Syu --needed --noconfirm yarn ruby-sass make git
- pacman -Syu --needed --noconfirm yarn ruby-sass make git svgcleaner
- make
- make dist
after_script:
......
......@@ -11,6 +11,7 @@ PORT ?= 9966
HOST ?= localhost
VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2>/dev/null | sed 's/^v//' || \
cat $(CURDIR)/.version 2> /dev/null || echo 0.0.0-unreleased)
ARCHLOGO = public/archlogo.8a05bc7f6cd1.svg
all: vendor
......@@ -33,7 +34,8 @@ dist: vendor
@mkdir -p "dist/${PACKAGE_NAME}-${VERSION}"
cp -avf public/index.html "dist/${PACKAGE_NAME}-${VERSION}/index.html"
# TODO: cache-invalidation with version string replaced in html file
cp -Lvf public/favicon.ico public/*.svg -t "dist/${PACKAGE_NAME}-${VERSION}/"
svgcleaner ${ARCHLOGO} "$dist/${PACKAGE_NAME}-${VERSION}/${ARCHLOGO}"
cp -vf public/favicon.ico -t "dist/${PACKAGE_NAME}-${VERSION}/"
$(SASS) -t compressed src/style.scss "dist/${PACKAGE_NAME}-${VERSION}/bundle.css"
$(YARN) run -s browserify -t babelify src/index.js | $(YARN) run -s terser --compress --mangle > "dist/${PACKAGE_NAME}-${VERSION}/bundle.js"
cd dist && tar --owner=0 --group=0 -czvf ${PACKAGE_NAME}-${VERSION}.tar.gz "${PACKAGE_NAME}-${VERSION}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment