Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
624c987e13 | ||
|
|
8412cc7d9d |
17
build.sh
17
build.sh
@@ -10,7 +10,15 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
function clean {
|
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 {
|
function build_frontend {
|
||||||
@@ -20,7 +28,7 @@ function build_frontend {
|
|||||||
cd "$dir"
|
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
|
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
|
cp ./dist/bundled-view-files.json ./backend/src/modules/view/bundled-view-files.json
|
||||||
}
|
}
|
||||||
@@ -28,7 +36,7 @@ function build_backend {
|
|||||||
function compile_for {
|
function compile_for {
|
||||||
target=$1
|
target=$1
|
||||||
mkdir -p "./dist/bin"
|
mkdir -p "./dist/bin"
|
||||||
deno compile --target "$target" --output "./dist/bin/$target" --allow-net --allow-read --allow-write --allow-sys ./backend/src/main.ts
|
deno compile --config "./backend/deno.json" --target "$target" --output "./dist/bin/$target" --allow-net --allow-read --allow-write --allow-sys --allow-run ./backend/src/main.ts
|
||||||
}
|
}
|
||||||
|
|
||||||
function compile_all {
|
function compile_all {
|
||||||
@@ -41,6 +49,7 @@ function compile_all {
|
|||||||
|
|
||||||
|
|
||||||
clean
|
clean
|
||||||
|
build_backend_npm_package
|
||||||
build_frontend
|
build_frontend
|
||||||
build_backend
|
bundle_frontend_files_info_single_json_file
|
||||||
compile_all
|
compile_all
|
||||||
Reference in New Issue
Block a user