ui build: create requires web/ui/static dir ad hoc

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
This commit is contained in:
Julius Volz 2024-09-09 18:28:57 +02:00 committed by Jan Fajerski
parent dadad9bd10
commit 785d595855
2 changed files with 8 additions and 6 deletions

3
.gitignore vendored
View file

@ -22,8 +22,7 @@ benchmark.txt
/documentation/examples/remote_storage/example_write_adapter/example_write_adapter
npm_licenses.tar.bz2
/web/ui/static/react-app
/web/ui/static/mantine-ui
/web/ui/static
/vendor
/.build

View file

@ -21,6 +21,7 @@ then
fi
buildOrder=(lezer-promql codemirror-promql)
assetsDir="./static"
function buildModule() {
for module in "${buildOrder[@]}"; do
@ -32,15 +33,17 @@ function buildModule() {
function buildReactApp() {
echo "build react-app"
(cd react-app && npm run build)
rm -rf ./static/react-app
mv ./react-app/build ./static/react-app
mkdir -p ${assetsDir}
rm -rf ${assetsDir}/react-app
mv ./react-app/build ${assetsDir}/react-app
}
function buildMantineUI() {
echo "build mantine-ui"
npm run build -w @prometheus-io/mantine-ui
rm -rf ./static/mantine-ui
mv ./mantine-ui/dist ./static/mantine-ui
mkdir -p ${assetsDir}
rm -rf ${assetsDir}/mantine-ui
mv ./mantine-ui/dist ${assetsDir}/mantine-ui
}
for i in "$@"; do