mirror of
https://github.com/Xevion/Pac-Man.git
synced 2026-01-31 08:25:06 -06:00
build(docker): remove wasm-opt optimization step
This commit is contained in:
@@ -74,11 +74,6 @@ RUN cargo build --release --target wasm32-unknown-emscripten --bin pacman
|
|||||||
FROM oven/bun:1 AS frontend-builder
|
FROM oven/bun:1 AS frontend-builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install binaryen for wasm-opt (WASM size optimization)
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y --no-install-recommends binaryen && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Copy package files for dependency installation
|
# Copy package files for dependency installation
|
||||||
COPY web/package.json web/bun.lock* ./
|
COPY web/package.json web/bun.lock* ./
|
||||||
RUN bun install --frozen-lockfile
|
RUN bun install --frozen-lockfile
|
||||||
@@ -92,12 +87,6 @@ COPY --from=wasm-builder /app/target/wasm32-unknown-emscripten/release/pacman.wa
|
|||||||
COPY --from=wasm-builder /app/target/wasm32-unknown-emscripten/release/pacman.js ./static/pacman.js
|
COPY --from=wasm-builder /app/target/wasm32-unknown-emscripten/release/pacman.js ./static/pacman.js
|
||||||
COPY --from=wasm-builder /app/target/wasm32-unknown-emscripten/release/deps/pacman.data ./static/pacman.data
|
COPY --from=wasm-builder /app/target/wasm32-unknown-emscripten/release/deps/pacman.data ./static/pacman.data
|
||||||
|
|
||||||
# Optimize WASM binary for size (typically 5-15% reduction)
|
|
||||||
RUN ORIGINAL_SIZE=$(stat -c%s ./static/pacman.wasm) && \
|
|
||||||
wasm-opt -Oz --strip-debug ./static/pacman.wasm -o ./static/pacman.wasm && \
|
|
||||||
OPTIMIZED_SIZE=$(stat -c%s ./static/pacman.wasm) && \
|
|
||||||
echo "WASM optimized: ${ORIGINAL_SIZE} -> ${OPTIMIZED_SIZE} bytes ($(( (ORIGINAL_SIZE - OPTIMIZED_SIZE) * 100 / ORIGINAL_SIZE ))% reduction)"
|
|
||||||
|
|
||||||
# Verify WASM artifacts exist and have reasonable sizes
|
# Verify WASM artifacts exist and have reasonable sizes
|
||||||
RUN test -f ./static/pacman.wasm && \
|
RUN test -f ./static/pacman.wasm && \
|
||||||
test -f ./static/pacman.js && \
|
test -f ./static/pacman.js && \
|
||||||
|
|||||||
Reference in New Issue
Block a user