Microfill
Only loads polyfills for the missing gabs.
How does it work
Microfill replaces your javascript file with a file that looks like this:
;{ var n = 0; if !windowsetImmediate n += 1 << 0; if !windowPromise n += 1 << 1; if !windowfetch n += 1 << 2; if !windowWeakMap || !windowMap || !windowSet n += 1 << 3; var script = document; scriptsrc = "file-" + n + ".js"; scripttype = "text/javascript"; documenthead;};
If a feature is missing, n
will be increased by a certain value. Based on the final value of n
a file will be loaded.
Microfill generates such file for every possible combination of polyfills that are needed. See the test
directory for a sample output.
How to use
Using node.js
var microfill = ; microfill;
Using gulp
Use gulp-microfill.
var gulp = ;var microfill = ; gulp;
Supported polyfills
set-immediate
promise
fetch
collections
(WeapMap, Map, Set)
License
MIT