Changed build process
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
.idea/
|
||||
www/res/scripts/*
|
||||
dest/
|
||||
*.sh
|
||||
|
22
Makefile
22
Makefile
@ -1,15 +1,21 @@
|
||||
.DEFAULT_GOAL := build
|
||||
.DEFAULT_GOAL := build-www
|
||||
|
||||
OUT=www/res/scripts
|
||||
build-www:
|
||||
mkdir -p dest/
|
||||
rm -rf dest/www
|
||||
cp -pr www dest/www
|
||||
|
||||
${OUT}/locutus.js ${OUT}/usimp.js: src/locutus.ts src/usimp.ts
|
||||
tsc
|
||||
|
||||
build: ${OUT}/locutus.js ${OUT}/usimp.js
|
||||
perl -i -pE 's/(\?v=[0-9]+\.[0-9]+\.[0-9]+\+)([0-9]+)/($$1).($$2+1)/eg' www/index.html
|
||||
sed -i 's:"\(/res/[^"]*\|/favicon.ico\|/app.webmanifest\)":"\1?v=$(shell date -u +%Y%m%d-%H%M%S)":g' dest/www/index.html
|
||||
perl -i -pE \
|
||||
"s/^(import .*)\"(.*?)(\.js)?(\?.*?)?\"/(\$$1).(\"\\\".\/\$$2.js$$(grep -oE '\?v=[0-9]+\.[0-9]+\.[0-9]+\+[0-9]+' www/index.html | tail -n 1)\\\"\")/ge" \
|
||||
www/res/scripts/*.js
|
||||
"s/^(import .*)\"(.*?)(\.js)?(\?.*?)?\"/(\$$1).(\"\\\".\/\$$2.js?v=$(shell date -u +%Y%m%d-%H%M%S)\\\"\")/ge" \
|
||||
dest/www/res/scripts/*.js
|
||||
|
||||
tools/minify-css.sh
|
||||
sed -i 's|/res/styles/styles.css|/res/styles/min.css|g' dest/www/index.html
|
||||
|
||||
#convert -background none dest/www/res/svgs/tucal.svg -alpha set -define icon:auto-resize=256,128,64,32,24,16 dest/www/favicon.ico
|
||||
|
||||
clean:
|
||||
rm -rf "${OUT}"
|
||||
rm -rf dest/
|
||||
|
@ -3,7 +3,7 @@
|
||||
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
||||
"target": "ES2020",
|
||||
"module": "ES2020",
|
||||
"outDir": "www/res/scripts",
|
||||
"outDir": "dest/www/res/scripts",
|
||||
"rootDir": "src",
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
|
@ -26,10 +26,10 @@ Distributed, end-to-end encrypted instant messaging."/>
|
||||
img-src * blob: data:;
|
||||
connect-src *;
|
||||
media-src * blob: data:;"/>
|
||||
<link rel="stylesheet" href="/res/styles/styles.css?v=0.0.0+123" type="text/css"/>
|
||||
<script type="module" src="/res/scripts/usimp.js?v=0.0.0+123"></script>
|
||||
<script type="module" src="/res/scripts/locutus.js?v=0.0.0+123"></script>
|
||||
<script type="module" src="/res/scripts/main.js?v=0.0.0+123"></script>
|
||||
<link rel="stylesheet" href="/res/styles/styles.css" type="text/css"/>
|
||||
<script type="module" src="/res/scripts/usimp.js"></script>
|
||||
<script type="module" src="/res/scripts/locutus.js"></script>
|
||||
<script type="module" src="/res/scripts/main.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
|
Reference in New Issue
Block a user