1
0
mirror of https://github.com/Luzifer/mapshare.git synced 2024-09-19 15:22:58 +00:00
mapshare/ci/bundle_js.sh

45 lines
1.0 KiB
Bash
Raw Permalink Normal View History

2020-01-06 20:56:17 +00:00
#!/bin/bash
set -euxo pipefail
leaflet_ver="1.7.1"
2020-01-06 20:56:17 +00:00
css_deps=(
# Must-have order
npm/bootstrap@4/dist/css/bootstrap.min.css
npm/bootswatch@4/dist/darkly/bootstrap.min.css
npm/bootstrap-vue@2/dist/bootstrap-vue.min.css
2020-01-06 20:56:17 +00:00
# Other packages
npm/leaflet@${leaflet_ver}/dist/leaflet.min.css
2020-01-06 20:56:17 +00:00
)
js_deps=(
# Must-have order
npm/vue@2/dist/vue.min.js
npm/bootstrap-vue@2/dist/bootstrap-vue.min.js
npm/vue-i18n@8.21.0/dist/vue-i18n.min.js
# Other packages
npm/leaflet@${leaflet_ver}/dist/leaflet.min.js
npm/moment@2.27.0/min/moment.min.js
2020-01-06 20:56:17 +00:00
)
2020-01-06 23:19:11 +00:00
leaflet_images=(
layers.png
layers-2x.png
marker-icon.png
marker-icon-2x.png
marker-shadow.png
2020-01-06 23:19:11 +00:00
)
rm -rf frontend/images
mkdir -p frontend/images
2020-01-06 23:19:11 +00:00
for img in "${leaflet_images[@]}"; do
curl -sSfLo "frontend/images/${img}" "https://cdn.jsdelivr.net/npm/leaflet@${leaflet_ver}/dist/images/${img}"
2020-01-06 23:19:11 +00:00
done
2020-01-06 20:56:17 +00:00
IFS=','
curl -sSfLo frontend/combine.js "https://cdn.jsdelivr.net/combine/${js_deps[*]}"
curl -sSfLo frontend/combine.css "https://cdn.jsdelivr.net/combine/${css_deps[*]}"