summaryrefslogtreecommitdiff
path: root/utils/lib_sxng_vite.sh
blob: 207bf2a84fc8558305ebf8026258abce7d157d9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# SPDX-License-Identifier: AGPL-3.0-or-later


vite.help(){
    cat <<EOF
vite.:  .. to be done ..
  simple.:
    build: build static files of the simple theme
    dev:   start development server
EOF
}

VITE_SIMPLE_THEME="${REPO_ROOT}/client/simple"
VITE_SIMPLE_DIST="${REPO_ROOT}/searx/static/themes/simple"

vite.simple.dev() {

    (   set -e
        build_msg SIMPLE "start server for FE development of: ${VITE_SIMPLE_THEME}"
        pushd "${VITE_SIMPLE_THEME}"
        npm install
        npm exec -- vite
        popd &> /dev/null
    )

}

vite.simple.build() {

    # build static files of the simple theme

    (   set -e
        build_msg SIMPLE "run build of theme from: ${VITE_SIMPLE_THEME}"

        pushd "${VITE_SIMPLE_THEME}"
        npm install
        npm run fix
        npm run build

    )
}