Extract targets parser and compat data from preset-env (#10899)

* Extract targets parser and compat data from preset-env

* Review by Jùnliàng

* isItemRequired -> targetsSupported

* Export isRequired
This commit is contained in:
Nicolò Ribaudo
2020-01-10 03:15:20 +01:00
committed by GitHub
parent 5f807ae45b
commit 04354d1556
59 changed files with 936 additions and 707 deletions

View File

@@ -0,0 +1,16 @@
"use strict";
module.exports = new Map();
// async -> regenerator is better than async -> generator -> regenerator
ifIncluded("transform-regenerator")
// Temporarly disabled: https://github.com/babel/babel/issues/10678
// .isUnnecessary("transform-async-to-generator");
function ifIncluded(name) {
const set = new Set();
module.exports.set(name, set);
return {
isUnnecessary(name) { set.add(name); return this; },
};
}