498
|
1 #!/bin/bash
|
|
2 set -e
|
|
3
|
|
4 mkdir -p build-final
|
|
5
|
|
6 # compile TS to JS
|
|
7 tsc --module commonjs --sourceMap -t ES2015 --outDir "build-tsc/" build-wasm/testWasmIntegratedCpp_generated.ts testWasmIntegrated.ts
|
|
8
|
499
|
9 # bundle JS files to final build dir
|
|
10 browserify "build-tsc/build-wasm/testWasmIntegratedCpp_generated.js" "build-tsc/testWasmIntegrated.js" -o "build-final/testWasmIntegratedApp.js"
|
|
11
|
|
12 # copy WASM loader JS file to final build dir
|
|
13 cp build-wasm/testWasmIntegratedCpp.js build-final/
|
498
|
14
|
|
15 # copy HTML start page to output dir
|
|
16 cp testWasmIntegrated.html build-final/
|
|
17
|
499
|
18
|
498
|
19 # copy styles to output dir
|
|
20 cp styles.css build-final/
|
|
21
|
|
22 # copy WASM binary to output dir
|
|
23 cp build-wasm/testWasmIntegratedCpp.wasm build-final/
|
|
24
|
|
25 sudo python3 serve.py
|
|
26
|