Merge pull request #785 from GoogleChromeLabs/hqx-build

This commit is contained in:
Surma
2020-07-28 18:50:43 +01:00
committed by GitHub
7 changed files with 4 additions and 15 deletions

BIN
codecs/.DS_Store vendored

Binary file not shown.

View File

@ -1,5 +1 @@
**/*.rs.bk
target
Cargo.lock
bin/
pkg/README.md
/target

View File

@ -7,8 +7,5 @@ RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
RUN mkdir /opt/binaryen && \
curl -L https://github.com/WebAssembly/binaryen/releases/download/1.38.32/binaryen-1.38.32-x86-linux.tar.gz | tar -xzf - -C /opt/binaryen --strip 1
RUN mkdir /opt/wabt && \
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.11/wabt-1.0.11-linux.tar.gz | tar -xzf - -C /opt/wabt --strip 1
ENV PATH="/opt/binaryen:/opt/wabt:${PATH}"
ENV PATH="/opt/binaryen:${PATH}"
WORKDIR /src

View File

@ -6,12 +6,8 @@ echo "============================================="
echo "Compiling wasm"
echo "============================================="
(
wasm-pack build
wasm-strip pkg/squooshhqx_bg.wasm
echo "Optimising Wasm so it doesn't break Chrome (this takes like 10-15mins. get a cup of tea)"
echo "Once https://crbug.com/974804 is fixed, we can remove this step"
wasm-pack build -- --verbose --locked
rm pkg/.gitignore
wasm-opt -Os --no-validation -o pkg/squooshhqx_bg.wasm pkg/squooshhqx_bg.wasm
)
echo "============================================="
echo "Compiling wasm done"

View File

@ -1,7 +1,7 @@
{
"name": "hqx",
"scripts": {
"build:image": "docker build -t squoosh-hqx .",
"build:image": "docker build -t squoosh-hqx - < Dockerfile",
"build": "docker run --rm -v $(pwd):/src squoosh-hqx ./build.sh"
}
}

Binary file not shown.

Binary file not shown.