mirror of
https://github.com/searxng/searxng.git
synced 2025-03-13 07:52:40 +00:00
Vite is a build tool, it consists of two major parts [1]: - A dev server that provides rich feature enhancements over native ES modules, for example extremely fast Hot Module Replacement (HMR). - A build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production. [1] https://vite.dev/guide/ Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
42 lines
834 B
Bash
42 lines
834 B
Bash
#!/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
|
|
|
|
)
|
|
}
|