mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 17:49:52 +00:00
Porting over few more improvements from #777 that can be applied to HQX despite the older Rust version: - Removed Cargo.lock from .gitignore (the file itself was added in the original PR, but is still ignored and wouldn't get committed on changes). - Removed couple of stray .DS_Store accidentally added in that PR. - Added a `--locked` to `wasm-pack` build to make sure we rebuild HQX with the same versions from Cargo.lock. - Removed separate `wasm-strip` and `wasm-opt -Os` steps from build.sh in HQX because they're already included in wasm-pack, and running twice only makes build slower.
Codecs
This folder contains a self-contained sub-project for each encoder and decoder that squoosh supplies.
Build
Each subproject can be built using Docker the following commands:
$ npm install
$ npm run build
This will build two files: <codec name>_<enc or dec>.js and <codec name>_<enc or dec>.wasm. It will most likely be necessary to set Module["locateFile"] to successfully load the .wasm file. When the .js file is loaded, a global <codec name>_<enc or dec> is created with the same API as an Emscripten Module.
Each codec will document its API in its README.