Find the cost of adding an npm package to your app's bundle size teardown.kelinci.dev
14
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: compress with brotli correctly

Mary b88e9ba6 76ec422c

+6 -4
+6 -4
src/npm/lib/bundler.ts
··· 63 63 64 64 if (isBrotliSupported === undefined) { 65 65 try { 66 - // @ts-expect-error 'br' is not in the type definition yet 67 - const size = await getCompressedSize(code, 'br'); 66 + // @ts-expect-error 'brotli' is not in the type definition yet 67 + const size = await getCompressedSize(code, 'brotli'); 68 + console.log(`[worker] brotli supported`); 68 69 isBrotliSupported = true; 69 70 return size; 70 71 } catch { 72 + console.log(`[worker] brotli not supported`); 71 73 isBrotliSupported = false; 72 74 return undefined; 73 75 } 74 76 } 75 77 76 - // @ts-expect-error 'br' is not in the type definition yet 77 - return getCompressedSize(code, 'br'); 78 + // @ts-expect-error 'brotli' is not in the type definition yet 79 + return getCompressedSize(code, 'brotli'); 78 80 } 79 81 80 82 // #endregion