Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

Disable auto-run just to be safe

Surmae38e7154a6c2
diff --git a/src/lib/codec-wrappers/mozjpeg-enc.ts b/src/lib/codec-wrappers/mozjpeg-enc.ts
index f74aeed2..3077bad1 100644
--- a/src/lib/codec-wrappers/mozjpeg-enc.ts
+++ b/src/lib/codec-wrappers/mozjpeg-enc.ts
@@ -20,10 +20,9 @@ export class MozJpegEncoder implements Encoder {
private api: Promise<ModuleAPI>;
constructor() {
this.emscriptenModule = new Promise(resolve => {
- // TODO: See if I can just use m.then()?
const m = mozjpeg_enc({
// Just to be safe, don’t automatically invoke any wasm functions
- // noInitialRun: false,
+ noInitialRun: false,
locateFile(url: string): string {
// Redirect the request for the wasm binary to whatever webpack gave us.
if(url.endsWith('.wasm')) {