Files
v2rayA/build.sh
easterNday 9e0916cd82 chore(compress): use webpack to compress the files of the web panel (#1189)
* Turn on Gzip compression on the front end;
    - Use compression-webpack-plugin plugin;
    - Configure in vue.config.js
    - Enable compression only in production mode
* Remove original compression method
2023-11-22 19:51:54 +08:00

17 lines
649 B
Bash
Executable File

#!/bin/bash
set -ex
CurrentDir="$(pwd)"
if [ -d "$CurrentDir/.git" ]; then
date=$(git -C "$CurrentDir" log -1 --format="%cd" --date=short | sed s/-//g)
count=$(git -C "$CurrentDir" rev-list --count HEAD)
commit=$(git -C "$CurrentDir" rev-parse --short HEAD)
version="unstable-$date.r${count}.$commit"
else
version="unstable"
fi
# https://github.com/webpack/webpack/issues/14532#issuecomment-947012063
cd "$CurrentDir"/gui && yarn && OUTPUT_DIR="$CurrentDir"/service/server/router/web yarn build
cd "$CurrentDir"/service && CGO_ENABLED=0 go build -ldflags "-X github.com/v2rayA/v2rayA/conf.Version=$version -s -w" -o "$CurrentDir"/v2raya