diff --git a/Makefile b/Makefile index e683978..a5d0607 100644 --- a/Makefile +++ b/Makefile @@ -13,11 +13,17 @@ # limitations under the License. kitchen: wasm kitchen/src/*.rs - cp -r web/dist kitchen/webdist cd kitchen; cargo build -wasm: web/index.html web/src/*.rs +release: wasmrelease + cd kitchen; cargo build --release + +wasmrelease: web/index.html web/src/*.rs web/src/components/*.rs + cd web; trunk build --release --public-url /ui/ --dist ../kitchen/webdist + +wasm: web/index.html web/src/*.rs web/src/components/*.rs cd web; trunk build --public-url /ui/ + cp -r web/dist kitchen/webdist clean: rm -rf web/dist/* kitchen/webdist \ No newline at end of file diff --git a/run.sh b/run.sh index 5d2ccf2..5735705 100755 --- a/run.sh +++ b/run.sh @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +EXAMPLES=${EXAMPLES:-../examples} make clean kitchen pushd web trunk serve \ @@ -21,7 +21,7 @@ trunkpid=$! popd trap "{ echo killing ${trunkpid}; kill -9 ${trunkpid}; }" EXIT pushd kitchen -echo Starting api server -cargo run -- serve --dir ../examples +echo Starting api server serving ${EXAMPLES} +cargo run -- serve --dir ${EXAMPLES} popd # This is ghetto but I'm doing it anyway \ No newline at end of file