make install

This commit is contained in:
Jovi Hsu 2021-11-02 13:07:32 +08:00
parent 11bdf28d67
commit abd4299df3
5 changed files with 39 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/target/ /target/
/build/
Cargo.lock Cargo.lock

8
Makefile.toml Normal file
View File

@ -0,0 +1,8 @@
[tasks.install]
dependencies = ["build", "member_flow"]
[tasks.member_flow]
run_task = { name = "member_flow", fork = true }
[env]
INSTALL_PATH= "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/build"

5
backend/Makefile.toml Normal file
View File

@ -0,0 +1,5 @@
[tasks.install]
script = '''
mkdir -p $INSTALL_PATH
cp $CARGO_MAKE_CRATE_TARGET_DIRECTORY/debug/$CARGO_MAKE_CRATE_NAME $INSTALL_PATH
'''

24
frontend/Makefile.toml Normal file
View File

@ -0,0 +1,24 @@
[tasks.build]
command = "wasm-pack"
args = ["build"]
[tasks.install]
dependencies=["install_wasm", "install_static"]
[tasks.install_wasm]
script = '''
mkdir -p $FE_WASM_INSTALL_PATH
cp -r ./pkg $FE_WASM_INSTALL_PATH
'''
[tasks.install_static]
script = '''
mkdir -p $FE_STATIC_INSTALL_PATH
cp www/index.* $FE_STATIC_INSTALL_PATH
cp www/bootstrap.js $FE_STATIC_INSTALL_PATH
'''
[env]
FE_WASM_INSTALL_PATH="${INSTALL_PATH}/html"
FE_STATIC_INSTALL_PATH="${INSTALL_PATH}/html/www"

View File

@ -1,4 +1,4 @@
import { run_app } from '../pkg/webgateway_bg.js'; import { run_app } from '../pkg/webgateway_fe_bg.js';
async function main() { async function main() {
run_app(); run_app();
} }