This commit is contained in:
Sebastian Seedorf
2020-11-16 12:44:08 +01:00
parent 258be989ba
commit 7ad9cd1904
24 changed files with 678 additions and 0 deletions

25
out/polyfill-worker.js Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// workers/add.js
const worker_1 = require("threads/worker");
const fs = require("fs");
const polyfill_analyzer_1 = require("@10xjs/polyfill-analyzer");
const polyfills_1 = require("@10xjs/polyfill-analyzer/dist/polyfills");
worker_1.expose(() => {
const exclude = [
"console.markTimeline",
"console.timeline",
"console.timelineEnd",
];
const featureList = polyfill_analyzer_1.analyze({
source: fs.readFileSync('./public/js/bundle.js', 'utf-8'),
include: polyfills_1.default.filter(x => !exclude.includes(x)),
// Not all features listed by polyfillLibrary.listAllPolyfills()` can be detected.
unsupportedPolyfill: 'ignore',
});
const feats = {};
for (const feature of featureList) {
feats[feature] = {};
}
return feats;
});