add backend npm package build step

This commit is contained in:
Robin Chappatte
2024-06-22 22:11:53 +02:00
parent 8412cc7d9d
commit 624c987e13

View File

@@ -10,7 +10,15 @@ then
fi
function clean {
rm -rf ./frontend/dist && rm -rf ./backend/dist && rm -rf ./dist
rm -rf ./frontend/dist && \
rm -rf ./backend/dist && \
rm -rf ./backend/npm && \
rm -rf ./dist && \
true
}
function build_backend_npm_package {
deno run --allow-env --allow-read --allow-write=./backend/npm --allow-run=npm ./backend/build-for-npm.ts ./backend/npm 1.0.0
}
function build_frontend {
@@ -20,7 +28,7 @@ function build_frontend {
cd "$dir"
}
function build_backend {
function bundle_frontend_files_info_single_json_file {
deno run --allow-read=./frontend/dist,./dist --allow-write=./dist ./bundle.ts ./frontend/dist ./dist/bundled-view-files.json
cp ./dist/bundled-view-files.json ./backend/src/modules/view/bundled-view-files.json
}
@@ -41,6 +49,7 @@ function compile_all {
clean
build_backend_npm_package
build_frontend
build_backend
bundle_frontend_files_info_single_json_file
compile_all