lib_sxng_vite.sh 861 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. vite.help(){
  4. cat <<EOF
  5. vite.: .. to be done ..
  6. simple.:
  7. build: build static files of the simple theme
  8. dev: start development server
  9. EOF
  10. }
  11. VITE_SIMPLE_THEME="${REPO_ROOT}/client/simple"
  12. VITE_SIMPLE_DIST="${REPO_ROOT}/searx/static/themes/simple"
  13. vite.simple.dev() {
  14. ( set -e
  15. build_msg SIMPLE "start server for FE development of: ${VITE_SIMPLE_THEME}"
  16. pushd "${VITE_SIMPLE_THEME}"
  17. npm install
  18. npm exec -- vite
  19. popd &> /dev/null
  20. )
  21. }
  22. vite.simple.build() {
  23. # build static files of the simple theme
  24. ( set -e
  25. build_msg SIMPLE "run build of theme from: ${VITE_SIMPLE_THEME}"
  26. pushd "${VITE_SIMPLE_THEME}"
  27. npm install
  28. npm run fix
  29. npm run icons.html
  30. npm run build
  31. )
  32. }