unfetch icon indicating copy to clipboard operation
unfetch copied to clipboard

Reuse header variable

Open avioli opened this issue 5 years ago • 1 comments

Shave off one more byte from plain js, and two from the polyfill. Unfortunately adds one byte to the umd build.

Before:

Build "unfetch" to dist:
        496 B: unfetch.js
        496 B: unfetch.mjs
        566 B: unfetch.umd.js
Build "unfetch" to polyfill:
        498 B: index.js

After:

Build "unfetch" to dist:
        495 B: unfetch.js
        496 B: unfetch.mjs
        567 B: unfetch.umd.js
Build "unfetch" to polyfill:
        496 B: index.js

avioli avatar Sep 18 '18 01:09 avioli

Nice find! This might not work when we move Response and Headers into their own constructors though.

developit avatar Sep 18 '18 02:09 developit