-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-wasm.sh
More file actions
34 lines (29 loc) · 977 Bytes
/
build-wasm.sh
File metadata and controls
34 lines (29 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Build script for SQL Parser WASM
echo "Building SQL Parser for WASM..."
# Check if wasm-pack is installed
if ! command -v wasm-pack &> /dev/null; then
echo "wasm-pack not found. Installing..."
cargo install wasm-pack
fi
# Build for web target
echo "Building for web target..."
wasm-pack build --target web --features wasm --out-dir pkg
if [ $? -eq 0 ]; then
echo "✅ Build successful!"
echo ""
echo "To test the WASM module:"
echo "1. Serve the examples directory with a local HTTP server"
echo "2. Open examples/wasm_example.html in your browser"
echo ""
echo "Example using Python's built-in server:"
echo " python -m http.server 8000"
echo " # Then open http://localhost:8000/examples/wasm_example.html"
echo ""
echo "Or using Node.js serve:"
echo " npx serve ."
echo " # Then open the provided URL and navigate to examples/wasm_example.html"
else
echo "❌ Build failed!"
exit 1
fi