diff --git a/build.sh b/build.sh index 8a3471d..a7231c4 100755 --- a/build.sh +++ b/build.sh @@ -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 \ No newline at end of file