forked from daren.hsu/line_push
update
This commit is contained in:
+158
-121
@@ -3,187 +3,224 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
exports.minVersions = exports.default = void 0;
|
||||
|
||||
var _pluginSyntaxAsyncGenerators = _interopRequireDefault(require("@babel/plugin-syntax-async-generators"));
|
||||
var _pluginSyntaxAsyncGenerators = require("@babel/plugin-syntax-async-generators");
|
||||
|
||||
var _pluginSyntaxClassProperties = _interopRequireDefault(require("@babel/plugin-syntax-class-properties"));
|
||||
var _pluginSyntaxClassProperties = require("@babel/plugin-syntax-class-properties");
|
||||
|
||||
var _pluginSyntaxDynamicImport = _interopRequireDefault(require("@babel/plugin-syntax-dynamic-import"));
|
||||
var _pluginSyntaxClassStaticBlock = require("@babel/plugin-syntax-class-static-block");
|
||||
|
||||
var _pluginSyntaxJsonStrings = _interopRequireDefault(require("@babel/plugin-syntax-json-strings"));
|
||||
var _pluginSyntaxDynamicImport = require("@babel/plugin-syntax-dynamic-import");
|
||||
|
||||
var _pluginSyntaxNullishCoalescingOperator = _interopRequireDefault(require("@babel/plugin-syntax-nullish-coalescing-operator"));
|
||||
var _pluginSyntaxExportNamespaceFrom = require("@babel/plugin-syntax-export-namespace-from");
|
||||
|
||||
var _pluginSyntaxNumericSeparator = _interopRequireDefault(require("@babel/plugin-syntax-numeric-separator"));
|
||||
var _pluginSyntaxImportAssertions = require("@babel/plugin-syntax-import-assertions");
|
||||
|
||||
var _pluginSyntaxObjectRestSpread = _interopRequireDefault(require("@babel/plugin-syntax-object-rest-spread"));
|
||||
var _pluginSyntaxJsonStrings = require("@babel/plugin-syntax-json-strings");
|
||||
|
||||
var _pluginSyntaxOptionalCatchBinding = _interopRequireDefault(require("@babel/plugin-syntax-optional-catch-binding"));
|
||||
var _pluginSyntaxLogicalAssignmentOperators = require("@babel/plugin-syntax-logical-assignment-operators");
|
||||
|
||||
var _pluginSyntaxOptionalChaining = _interopRequireDefault(require("@babel/plugin-syntax-optional-chaining"));
|
||||
var _pluginSyntaxNullishCoalescingOperator = require("@babel/plugin-syntax-nullish-coalescing-operator");
|
||||
|
||||
var _pluginSyntaxTopLevelAwait = _interopRequireDefault(require("@babel/plugin-syntax-top-level-await"));
|
||||
var _pluginSyntaxNumericSeparator = require("@babel/plugin-syntax-numeric-separator");
|
||||
|
||||
var _pluginProposalAsyncGeneratorFunctions = _interopRequireDefault(require("@babel/plugin-proposal-async-generator-functions"));
|
||||
var _pluginSyntaxObjectRestSpread = require("@babel/plugin-syntax-object-rest-spread");
|
||||
|
||||
var _pluginProposalClassProperties = _interopRequireDefault(require("@babel/plugin-proposal-class-properties"));
|
||||
var _pluginSyntaxOptionalCatchBinding = require("@babel/plugin-syntax-optional-catch-binding");
|
||||
|
||||
var _pluginProposalDynamicImport = _interopRequireDefault(require("@babel/plugin-proposal-dynamic-import"));
|
||||
var _pluginSyntaxOptionalChaining = require("@babel/plugin-syntax-optional-chaining");
|
||||
|
||||
var _pluginProposalJsonStrings = _interopRequireDefault(require("@babel/plugin-proposal-json-strings"));
|
||||
var _pluginSyntaxPrivatePropertyInObject = require("@babel/plugin-syntax-private-property-in-object");
|
||||
|
||||
var _pluginProposalNullishCoalescingOperator = _interopRequireDefault(require("@babel/plugin-proposal-nullish-coalescing-operator"));
|
||||
var _pluginSyntaxTopLevelAwait = require("@babel/plugin-syntax-top-level-await");
|
||||
|
||||
var _pluginProposalNumericSeparator = _interopRequireDefault(require("@babel/plugin-proposal-numeric-separator"));
|
||||
var _pluginProposalAsyncGeneratorFunctions = require("@babel/plugin-proposal-async-generator-functions");
|
||||
|
||||
var _pluginProposalObjectRestSpread = _interopRequireDefault(require("@babel/plugin-proposal-object-rest-spread"));
|
||||
var _pluginProposalClassProperties = require("@babel/plugin-proposal-class-properties");
|
||||
|
||||
var _pluginProposalOptionalCatchBinding = _interopRequireDefault(require("@babel/plugin-proposal-optional-catch-binding"));
|
||||
var _pluginProposalClassStaticBlock = require("@babel/plugin-proposal-class-static-block");
|
||||
|
||||
var _pluginProposalOptionalChaining = _interopRequireDefault(require("@babel/plugin-proposal-optional-chaining"));
|
||||
var _pluginProposalDynamicImport = require("@babel/plugin-proposal-dynamic-import");
|
||||
|
||||
var _pluginProposalPrivateMethods = _interopRequireDefault(require("@babel/plugin-proposal-private-methods"));
|
||||
var _pluginProposalExportNamespaceFrom = require("@babel/plugin-proposal-export-namespace-from");
|
||||
|
||||
var _pluginProposalUnicodePropertyRegex = _interopRequireDefault(require("@babel/plugin-proposal-unicode-property-regex"));
|
||||
var _pluginProposalJsonStrings = require("@babel/plugin-proposal-json-strings");
|
||||
|
||||
var _pluginTransformAsyncToGenerator = _interopRequireDefault(require("@babel/plugin-transform-async-to-generator"));
|
||||
var _pluginProposalLogicalAssignmentOperators = require("@babel/plugin-proposal-logical-assignment-operators");
|
||||
|
||||
var _pluginTransformArrowFunctions = _interopRequireDefault(require("@babel/plugin-transform-arrow-functions"));
|
||||
var _pluginProposalNullishCoalescingOperator = require("@babel/plugin-proposal-nullish-coalescing-operator");
|
||||
|
||||
var _pluginTransformBlockScopedFunctions = _interopRequireDefault(require("@babel/plugin-transform-block-scoped-functions"));
|
||||
var _pluginProposalNumericSeparator = require("@babel/plugin-proposal-numeric-separator");
|
||||
|
||||
var _pluginTransformBlockScoping = _interopRequireDefault(require("@babel/plugin-transform-block-scoping"));
|
||||
var _pluginProposalObjectRestSpread = require("@babel/plugin-proposal-object-rest-spread");
|
||||
|
||||
var _pluginTransformClasses = _interopRequireDefault(require("@babel/plugin-transform-classes"));
|
||||
var _pluginProposalOptionalCatchBinding = require("@babel/plugin-proposal-optional-catch-binding");
|
||||
|
||||
var _pluginTransformComputedProperties = _interopRequireDefault(require("@babel/plugin-transform-computed-properties"));
|
||||
var _pluginProposalOptionalChaining = require("@babel/plugin-proposal-optional-chaining");
|
||||
|
||||
var _pluginTransformDestructuring = _interopRequireDefault(require("@babel/plugin-transform-destructuring"));
|
||||
var _pluginProposalPrivateMethods = require("@babel/plugin-proposal-private-methods");
|
||||
|
||||
var _pluginTransformDotallRegex = _interopRequireDefault(require("@babel/plugin-transform-dotall-regex"));
|
||||
var _pluginProposalPrivatePropertyInObject = require("@babel/plugin-proposal-private-property-in-object");
|
||||
|
||||
var _pluginTransformDuplicateKeys = _interopRequireDefault(require("@babel/plugin-transform-duplicate-keys"));
|
||||
var _pluginProposalUnicodePropertyRegex = require("@babel/plugin-proposal-unicode-property-regex");
|
||||
|
||||
var _pluginTransformExponentiationOperator = _interopRequireDefault(require("@babel/plugin-transform-exponentiation-operator"));
|
||||
var _pluginTransformAsyncToGenerator = require("@babel/plugin-transform-async-to-generator");
|
||||
|
||||
var _pluginTransformForOf = _interopRequireDefault(require("@babel/plugin-transform-for-of"));
|
||||
var _pluginTransformArrowFunctions = require("@babel/plugin-transform-arrow-functions");
|
||||
|
||||
var _pluginTransformFunctionName = _interopRequireDefault(require("@babel/plugin-transform-function-name"));
|
||||
var _pluginTransformBlockScopedFunctions = require("@babel/plugin-transform-block-scoped-functions");
|
||||
|
||||
var _pluginTransformLiterals = _interopRequireDefault(require("@babel/plugin-transform-literals"));
|
||||
var _pluginTransformBlockScoping = require("@babel/plugin-transform-block-scoping");
|
||||
|
||||
var _pluginTransformMemberExpressionLiterals = _interopRequireDefault(require("@babel/plugin-transform-member-expression-literals"));
|
||||
var _pluginTransformClasses = require("@babel/plugin-transform-classes");
|
||||
|
||||
var _pluginTransformModulesAmd = _interopRequireDefault(require("@babel/plugin-transform-modules-amd"));
|
||||
var _pluginTransformComputedProperties = require("@babel/plugin-transform-computed-properties");
|
||||
|
||||
var _pluginTransformModulesCommonjs = _interopRequireDefault(require("@babel/plugin-transform-modules-commonjs"));
|
||||
var _pluginTransformDestructuring = require("@babel/plugin-transform-destructuring");
|
||||
|
||||
var _pluginTransformModulesSystemjs = _interopRequireDefault(require("@babel/plugin-transform-modules-systemjs"));
|
||||
var _pluginTransformDotallRegex = require("@babel/plugin-transform-dotall-regex");
|
||||
|
||||
var _pluginTransformModulesUmd = _interopRequireDefault(require("@babel/plugin-transform-modules-umd"));
|
||||
var _pluginTransformDuplicateKeys = require("@babel/plugin-transform-duplicate-keys");
|
||||
|
||||
var _pluginTransformNamedCapturingGroupsRegex = _interopRequireDefault(require("@babel/plugin-transform-named-capturing-groups-regex"));
|
||||
var _pluginTransformExponentiationOperator = require("@babel/plugin-transform-exponentiation-operator");
|
||||
|
||||
var _pluginTransformNewTarget = _interopRequireDefault(require("@babel/plugin-transform-new-target"));
|
||||
var _pluginTransformForOf = require("@babel/plugin-transform-for-of");
|
||||
|
||||
var _pluginTransformObjectSuper = _interopRequireDefault(require("@babel/plugin-transform-object-super"));
|
||||
var _pluginTransformFunctionName = require("@babel/plugin-transform-function-name");
|
||||
|
||||
var _pluginTransformParameters = _interopRequireDefault(require("@babel/plugin-transform-parameters"));
|
||||
var _pluginTransformLiterals = require("@babel/plugin-transform-literals");
|
||||
|
||||
var _pluginTransformPropertyLiterals = _interopRequireDefault(require("@babel/plugin-transform-property-literals"));
|
||||
var _pluginTransformMemberExpressionLiterals = require("@babel/plugin-transform-member-expression-literals");
|
||||
|
||||
var _pluginTransformRegenerator = _interopRequireDefault(require("@babel/plugin-transform-regenerator"));
|
||||
var _pluginTransformModulesAmd = require("@babel/plugin-transform-modules-amd");
|
||||
|
||||
var _pluginTransformReservedWords = _interopRequireDefault(require("@babel/plugin-transform-reserved-words"));
|
||||
var _pluginTransformModulesCommonjs = require("@babel/plugin-transform-modules-commonjs");
|
||||
|
||||
var _pluginTransformShorthandProperties = _interopRequireDefault(require("@babel/plugin-transform-shorthand-properties"));
|
||||
var _pluginTransformModulesSystemjs = require("@babel/plugin-transform-modules-systemjs");
|
||||
|
||||
var _pluginTransformSpread = _interopRequireDefault(require("@babel/plugin-transform-spread"));
|
||||
var _pluginTransformModulesUmd = require("@babel/plugin-transform-modules-umd");
|
||||
|
||||
var _pluginTransformStickyRegex = _interopRequireDefault(require("@babel/plugin-transform-sticky-regex"));
|
||||
var _pluginTransformNamedCapturingGroupsRegex = require("@babel/plugin-transform-named-capturing-groups-regex");
|
||||
|
||||
var _pluginTransformTemplateLiterals = _interopRequireDefault(require("@babel/plugin-transform-template-literals"));
|
||||
var _pluginTransformNewTarget = require("@babel/plugin-transform-new-target");
|
||||
|
||||
var _pluginTransformTypeofSymbol = _interopRequireDefault(require("@babel/plugin-transform-typeof-symbol"));
|
||||
var _pluginTransformObjectSuper = require("@babel/plugin-transform-object-super");
|
||||
|
||||
var _pluginTransformUnicodeEscapes = _interopRequireDefault(require("@babel/plugin-transform-unicode-escapes"));
|
||||
var _pluginTransformParameters = require("@babel/plugin-transform-parameters");
|
||||
|
||||
var _pluginTransformUnicodeRegex = _interopRequireDefault(require("@babel/plugin-transform-unicode-regex"));
|
||||
var _pluginTransformPropertyLiterals = require("@babel/plugin-transform-property-literals");
|
||||
|
||||
var _transformAsyncArrowsInClass = _interopRequireDefault(require("@babel/preset-modules/lib/plugins/transform-async-arrows-in-class"));
|
||||
var _pluginTransformRegenerator = require("@babel/plugin-transform-regenerator");
|
||||
|
||||
var _transformEdgeDefaultParameters = _interopRequireDefault(require("@babel/preset-modules/lib/plugins/transform-edge-default-parameters"));
|
||||
var _pluginTransformReservedWords = require("@babel/plugin-transform-reserved-words");
|
||||
|
||||
var _transformEdgeFunctionName = _interopRequireDefault(require("@babel/preset-modules/lib/plugins/transform-edge-function-name"));
|
||||
var _pluginTransformShorthandProperties = require("@babel/plugin-transform-shorthand-properties");
|
||||
|
||||
var _transformTaggedTemplateCaching = _interopRequireDefault(require("@babel/preset-modules/lib/plugins/transform-tagged-template-caching"));
|
||||
var _pluginTransformSpread = require("@babel/plugin-transform-spread");
|
||||
|
||||
var _transformSafariBlockShadowing = _interopRequireDefault(require("@babel/preset-modules/lib/plugins/transform-safari-block-shadowing"));
|
||||
var _pluginTransformStickyRegex = require("@babel/plugin-transform-sticky-regex");
|
||||
|
||||
var _transformSafariForShadowing = _interopRequireDefault(require("@babel/preset-modules/lib/plugins/transform-safari-for-shadowing"));
|
||||
var _pluginTransformTemplateLiterals = require("@babel/plugin-transform-template-literals");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
var _pluginTransformTypeofSymbol = require("@babel/plugin-transform-typeof-symbol");
|
||||
|
||||
var _pluginTransformUnicodeEscapes = require("@babel/plugin-transform-unicode-escapes");
|
||||
|
||||
var _pluginTransformUnicodeRegex = require("@babel/plugin-transform-unicode-regex");
|
||||
|
||||
var _transformAsyncArrowsInClass = require("@babel/preset-modules/lib/plugins/transform-async-arrows-in-class");
|
||||
|
||||
var _transformEdgeDefaultParameters = require("@babel/preset-modules/lib/plugins/transform-edge-default-parameters");
|
||||
|
||||
var _transformEdgeFunctionName = require("@babel/preset-modules/lib/plugins/transform-edge-function-name");
|
||||
|
||||
var _transformTaggedTemplateCaching = require("@babel/preset-modules/lib/plugins/transform-tagged-template-caching");
|
||||
|
||||
var _transformSafariBlockShadowing = require("@babel/preset-modules/lib/plugins/transform-safari-block-shadowing");
|
||||
|
||||
var _transformSafariForShadowing = require("@babel/preset-modules/lib/plugins/transform-safari-for-shadowing");
|
||||
|
||||
var _pluginBugfixSafariIdDestructuringCollisionInFunctionExpression = require("@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression");
|
||||
|
||||
var _pluginBugfixV8SpreadParametersInOptionalChaining = require("@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining");
|
||||
|
||||
var _default = {
|
||||
"bugfix/transform-async-arrows-in-class": _transformAsyncArrowsInClass.default,
|
||||
"bugfix/transform-edge-default-parameters": _transformEdgeDefaultParameters.default,
|
||||
"bugfix/transform-edge-function-name": _transformEdgeFunctionName.default,
|
||||
"bugfix/transform-safari-block-shadowing": _transformSafariBlockShadowing.default,
|
||||
"bugfix/transform-safari-for-shadowing": _transformSafariForShadowing.default,
|
||||
"bugfix/transform-tagged-template-caching": _transformTaggedTemplateCaching.default,
|
||||
"proposal-async-generator-functions": _pluginProposalAsyncGeneratorFunctions.default,
|
||||
"proposal-class-properties": _pluginProposalClassProperties.default,
|
||||
"proposal-dynamic-import": _pluginProposalDynamicImport.default,
|
||||
"proposal-json-strings": _pluginProposalJsonStrings.default,
|
||||
"proposal-nullish-coalescing-operator": _pluginProposalNullishCoalescingOperator.default,
|
||||
"proposal-numeric-separator": _pluginProposalNumericSeparator.default,
|
||||
"proposal-object-rest-spread": _pluginProposalObjectRestSpread.default,
|
||||
"proposal-optional-catch-binding": _pluginProposalOptionalCatchBinding.default,
|
||||
"proposal-optional-chaining": _pluginProposalOptionalChaining.default,
|
||||
"proposal-private-methods": _pluginProposalPrivateMethods.default,
|
||||
"proposal-unicode-property-regex": _pluginProposalUnicodePropertyRegex.default,
|
||||
"syntax-async-generators": _pluginSyntaxAsyncGenerators.default,
|
||||
"syntax-class-properties": _pluginSyntaxClassProperties.default,
|
||||
"syntax-dynamic-import": _pluginSyntaxDynamicImport.default,
|
||||
"syntax-json-strings": _pluginSyntaxJsonStrings.default,
|
||||
"syntax-nullish-coalescing-operator": _pluginSyntaxNullishCoalescingOperator.default,
|
||||
"syntax-numeric-separator": _pluginSyntaxNumericSeparator.default,
|
||||
"syntax-object-rest-spread": _pluginSyntaxObjectRestSpread.default,
|
||||
"syntax-optional-catch-binding": _pluginSyntaxOptionalCatchBinding.default,
|
||||
"syntax-optional-chaining": _pluginSyntaxOptionalChaining.default,
|
||||
"syntax-top-level-await": _pluginSyntaxTopLevelAwait.default,
|
||||
"transform-arrow-functions": _pluginTransformArrowFunctions.default,
|
||||
"transform-async-to-generator": _pluginTransformAsyncToGenerator.default,
|
||||
"transform-block-scoped-functions": _pluginTransformBlockScopedFunctions.default,
|
||||
"transform-block-scoping": _pluginTransformBlockScoping.default,
|
||||
"transform-classes": _pluginTransformClasses.default,
|
||||
"transform-computed-properties": _pluginTransformComputedProperties.default,
|
||||
"transform-destructuring": _pluginTransformDestructuring.default,
|
||||
"transform-dotall-regex": _pluginTransformDotallRegex.default,
|
||||
"transform-duplicate-keys": _pluginTransformDuplicateKeys.default,
|
||||
"transform-exponentiation-operator": _pluginTransformExponentiationOperator.default,
|
||||
"transform-for-of": _pluginTransformForOf.default,
|
||||
"transform-function-name": _pluginTransformFunctionName.default,
|
||||
"transform-literals": _pluginTransformLiterals.default,
|
||||
"transform-member-expression-literals": _pluginTransformMemberExpressionLiterals.default,
|
||||
"transform-modules-amd": _pluginTransformModulesAmd.default,
|
||||
"transform-modules-commonjs": _pluginTransformModulesCommonjs.default,
|
||||
"transform-modules-systemjs": _pluginTransformModulesSystemjs.default,
|
||||
"transform-modules-umd": _pluginTransformModulesUmd.default,
|
||||
"transform-named-capturing-groups-regex": _pluginTransformNamedCapturingGroupsRegex.default,
|
||||
"transform-new-target": _pluginTransformNewTarget.default,
|
||||
"transform-object-super": _pluginTransformObjectSuper.default,
|
||||
"transform-parameters": _pluginTransformParameters.default,
|
||||
"transform-property-literals": _pluginTransformPropertyLiterals.default,
|
||||
"transform-regenerator": _pluginTransformRegenerator.default,
|
||||
"transform-reserved-words": _pluginTransformReservedWords.default,
|
||||
"transform-shorthand-properties": _pluginTransformShorthandProperties.default,
|
||||
"transform-spread": _pluginTransformSpread.default,
|
||||
"transform-sticky-regex": _pluginTransformStickyRegex.default,
|
||||
"transform-template-literals": _pluginTransformTemplateLiterals.default,
|
||||
"transform-typeof-symbol": _pluginTransformTypeofSymbol.default,
|
||||
"transform-unicode-escapes": _pluginTransformUnicodeEscapes.default,
|
||||
"transform-unicode-regex": _pluginTransformUnicodeRegex.default
|
||||
"bugfix/transform-async-arrows-in-class": () => _transformAsyncArrowsInClass,
|
||||
"bugfix/transform-edge-default-parameters": () => _transformEdgeDefaultParameters,
|
||||
"bugfix/transform-edge-function-name": () => _transformEdgeFunctionName,
|
||||
"bugfix/transform-safari-block-shadowing": () => _transformSafariBlockShadowing,
|
||||
"bugfix/transform-safari-for-shadowing": () => _transformSafariForShadowing,
|
||||
"bugfix/transform-safari-id-destructuring-collision-in-function-expression": () => _pluginBugfixSafariIdDestructuringCollisionInFunctionExpression.default,
|
||||
"bugfix/transform-tagged-template-caching": () => _transformTaggedTemplateCaching,
|
||||
"bugfix/transform-v8-spread-parameters-in-optional-chaining": () => _pluginBugfixV8SpreadParametersInOptionalChaining.default,
|
||||
"proposal-async-generator-functions": () => _pluginProposalAsyncGeneratorFunctions.default,
|
||||
"proposal-class-properties": () => _pluginProposalClassProperties.default,
|
||||
"proposal-class-static-block": () => _pluginProposalClassStaticBlock.default,
|
||||
"proposal-dynamic-import": () => _pluginProposalDynamicImport.default,
|
||||
"proposal-export-namespace-from": () => _pluginProposalExportNamespaceFrom.default,
|
||||
"proposal-json-strings": () => _pluginProposalJsonStrings.default,
|
||||
"proposal-logical-assignment-operators": () => _pluginProposalLogicalAssignmentOperators.default,
|
||||
"proposal-nullish-coalescing-operator": () => _pluginProposalNullishCoalescingOperator.default,
|
||||
"proposal-numeric-separator": () => _pluginProposalNumericSeparator.default,
|
||||
"proposal-object-rest-spread": () => _pluginProposalObjectRestSpread.default,
|
||||
"proposal-optional-catch-binding": () => _pluginProposalOptionalCatchBinding.default,
|
||||
"proposal-optional-chaining": () => _pluginProposalOptionalChaining.default,
|
||||
"proposal-private-methods": () => _pluginProposalPrivateMethods.default,
|
||||
"proposal-private-property-in-object": () => _pluginProposalPrivatePropertyInObject.default,
|
||||
"proposal-unicode-property-regex": () => _pluginProposalUnicodePropertyRegex.default,
|
||||
"syntax-async-generators": () => _pluginSyntaxAsyncGenerators,
|
||||
"syntax-class-properties": () => _pluginSyntaxClassProperties,
|
||||
"syntax-class-static-block": () => _pluginSyntaxClassStaticBlock,
|
||||
"syntax-dynamic-import": () => _pluginSyntaxDynamicImport,
|
||||
"syntax-export-namespace-from": () => _pluginSyntaxExportNamespaceFrom,
|
||||
"syntax-import-assertions": () => _pluginSyntaxImportAssertions.default,
|
||||
"syntax-json-strings": () => _pluginSyntaxJsonStrings,
|
||||
"syntax-logical-assignment-operators": () => _pluginSyntaxLogicalAssignmentOperators,
|
||||
"syntax-nullish-coalescing-operator": () => _pluginSyntaxNullishCoalescingOperator,
|
||||
"syntax-numeric-separator": () => _pluginSyntaxNumericSeparator,
|
||||
"syntax-object-rest-spread": () => _pluginSyntaxObjectRestSpread,
|
||||
"syntax-optional-catch-binding": () => _pluginSyntaxOptionalCatchBinding,
|
||||
"syntax-optional-chaining": () => _pluginSyntaxOptionalChaining,
|
||||
"syntax-private-property-in-object": () => _pluginSyntaxPrivatePropertyInObject,
|
||||
"syntax-top-level-await": () => _pluginSyntaxTopLevelAwait,
|
||||
"transform-arrow-functions": () => _pluginTransformArrowFunctions.default,
|
||||
"transform-async-to-generator": () => _pluginTransformAsyncToGenerator.default,
|
||||
"transform-block-scoped-functions": () => _pluginTransformBlockScopedFunctions.default,
|
||||
"transform-block-scoping": () => _pluginTransformBlockScoping.default,
|
||||
"transform-classes": () => _pluginTransformClasses.default,
|
||||
"transform-computed-properties": () => _pluginTransformComputedProperties.default,
|
||||
"transform-destructuring": () => _pluginTransformDestructuring.default,
|
||||
"transform-dotall-regex": () => _pluginTransformDotallRegex.default,
|
||||
"transform-duplicate-keys": () => _pluginTransformDuplicateKeys.default,
|
||||
"transform-exponentiation-operator": () => _pluginTransformExponentiationOperator.default,
|
||||
"transform-for-of": () => _pluginTransformForOf.default,
|
||||
"transform-function-name": () => _pluginTransformFunctionName.default,
|
||||
"transform-literals": () => _pluginTransformLiterals.default,
|
||||
"transform-member-expression-literals": () => _pluginTransformMemberExpressionLiterals.default,
|
||||
"transform-modules-amd": () => _pluginTransformModulesAmd.default,
|
||||
"transform-modules-commonjs": () => _pluginTransformModulesCommonjs.default,
|
||||
"transform-modules-systemjs": () => _pluginTransformModulesSystemjs.default,
|
||||
"transform-modules-umd": () => _pluginTransformModulesUmd.default,
|
||||
"transform-named-capturing-groups-regex": () => _pluginTransformNamedCapturingGroupsRegex.default,
|
||||
"transform-new-target": () => _pluginTransformNewTarget.default,
|
||||
"transform-object-super": () => _pluginTransformObjectSuper.default,
|
||||
"transform-parameters": () => _pluginTransformParameters.default,
|
||||
"transform-property-literals": () => _pluginTransformPropertyLiterals.default,
|
||||
"transform-regenerator": () => _pluginTransformRegenerator.default,
|
||||
"transform-reserved-words": () => _pluginTransformReservedWords.default,
|
||||
"transform-shorthand-properties": () => _pluginTransformShorthandProperties.default,
|
||||
"transform-spread": () => _pluginTransformSpread.default,
|
||||
"transform-sticky-regex": () => _pluginTransformStickyRegex.default,
|
||||
"transform-template-literals": () => _pluginTransformTemplateLiterals.default,
|
||||
"transform-typeof-symbol": () => _pluginTransformTypeofSymbol.default,
|
||||
"transform-unicode-escapes": () => _pluginTransformUnicodeEscapes.default,
|
||||
"transform-unicode-regex": () => _pluginTransformUnicodeRegex.default
|
||||
};
|
||||
exports.default = _default;
|
||||
exports.default = _default;
|
||||
const minVersions = {
|
||||
"bugfix/transform-safari-id-destructuring-collision-in-function-expression": "7.16.0",
|
||||
"proposal-class-static-block": "7.12.0",
|
||||
"proposal-private-property-in-object": "7.10.0"
|
||||
};
|
||||
exports.minVersions = minVersions;
|
||||
+21
-51
@@ -3,61 +3,31 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.logUsagePolyfills = exports.logEntryPolyfills = exports.logPluginOrPolyfill = void 0;
|
||||
exports.logPlugin = void 0;
|
||||
|
||||
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
|
||||
|
||||
const wordEnds = size => {
|
||||
return size > 1 ? "s" : "";
|
||||
};
|
||||
|
||||
const logPluginOrPolyfill = (item, targetVersions, list) => {
|
||||
const logPlugin = (item, targetVersions, list) => {
|
||||
const filteredList = (0, _helperCompilationTargets.getInclusionReasons)(item, targetVersions, list);
|
||||
const formattedTargets = JSON.stringify(filteredList).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }');
|
||||
const support = list[item];
|
||||
|
||||
if (!support) {
|
||||
console.log(` ${item}`);
|
||||
return;
|
||||
}
|
||||
|
||||
let formattedTargets = `{`;
|
||||
let first = true;
|
||||
|
||||
for (const target of Object.keys(filteredList)) {
|
||||
if (!first) formattedTargets += `,`;
|
||||
first = false;
|
||||
formattedTargets += ` ${target}`;
|
||||
if (support[target]) formattedTargets += ` < ${support[target]}`;
|
||||
}
|
||||
|
||||
formattedTargets += ` }`;
|
||||
console.log(` ${item} ${formattedTargets}`);
|
||||
};
|
||||
|
||||
exports.logPluginOrPolyfill = logPluginOrPolyfill;
|
||||
|
||||
const logEntryPolyfills = (polyfillName, importPolyfillIncluded, polyfills, filename, polyfillTargets, allBuiltInsList) => {
|
||||
if (process.env.BABEL_ENV === "test") {
|
||||
filename = filename.replace(/\\/g, "/");
|
||||
}
|
||||
|
||||
if (!importPolyfillIncluded) {
|
||||
console.log(`\n[${filename}] Import of ${polyfillName} was not found.`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!polyfills.size) {
|
||||
console.log(`\n[${filename}] Based on your targets, polyfills were not added.`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`\n[${filename}] Replaced ${polyfillName} entries with the following polyfill${wordEnds(polyfills.size)}:`);
|
||||
|
||||
for (const polyfill of polyfills) {
|
||||
logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);
|
||||
}
|
||||
};
|
||||
|
||||
exports.logEntryPolyfills = logEntryPolyfills;
|
||||
|
||||
const logUsagePolyfills = (polyfills, filename, polyfillTargets, allBuiltInsList) => {
|
||||
if (process.env.BABEL_ENV === "test") {
|
||||
filename = filename.replace(/\\/g, "/");
|
||||
}
|
||||
|
||||
if (!polyfills.size) {
|
||||
console.log(`\n[${filename}] Based on your code and targets, core-js polyfills were not added.`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`\n[${filename}] Added following core-js polyfill${wordEnds(polyfills.size)}:`);
|
||||
|
||||
for (const polyfill of polyfills) {
|
||||
logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);
|
||||
}
|
||||
};
|
||||
|
||||
exports.logUsagePolyfills = logUsagePolyfills;
|
||||
exports.logPlugin = logPlugin;
|
||||
+22
@@ -3,7 +3,21 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.addProposalSyntaxPlugins = addProposalSyntaxPlugins;
|
||||
exports.removeUnnecessaryItems = removeUnnecessaryItems;
|
||||
exports.removeUnsupportedItems = removeUnsupportedItems;
|
||||
|
||||
var _semver = require("semver");
|
||||
|
||||
var _availablePlugins = require("./available-plugins");
|
||||
|
||||
const has = Function.call.bind(Object.hasOwnProperty);
|
||||
|
||||
function addProposalSyntaxPlugins(items, proposalSyntaxPlugins) {
|
||||
proposalSyntaxPlugins.forEach(plugin => {
|
||||
items.add(plugin);
|
||||
});
|
||||
}
|
||||
|
||||
function removeUnnecessaryItems(items, overlapping) {
|
||||
items.forEach(item => {
|
||||
@@ -11,4 +25,12 @@ function removeUnnecessaryItems(items, overlapping) {
|
||||
|
||||
(_overlapping$item = overlapping[item]) == null ? void 0 : _overlapping$item.forEach(name => items.delete(name));
|
||||
});
|
||||
}
|
||||
|
||||
function removeUnsupportedItems(items, babelVersion) {
|
||||
items.forEach(item => {
|
||||
if (has(_availablePlugins.minVersions, item) && _semver.lt(babelVersion, _availablePlugins.minVersions[item])) {
|
||||
items.delete(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
+116
-66
@@ -3,52 +3,47 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getPolyfillPlugins = exports.getModulesPluginNames = exports.default = void 0;
|
||||
exports.isPluginRequired = isPluginRequired;
|
||||
exports.default = exports.getPolyfillPlugins = exports.getModulesPluginNames = exports.transformIncludesAndExcludes = void 0;
|
||||
exports.transformIncludesAndExcludes = void 0;
|
||||
|
||||
var _semver = require("semver");
|
||||
|
||||
var _debug = require("./debug");
|
||||
|
||||
var _getOptionSpecificExcludes = _interopRequireDefault(require("./get-option-specific-excludes"));
|
||||
var _getOptionSpecificExcludes = require("./get-option-specific-excludes");
|
||||
|
||||
var _filterItems = require("./filter-items");
|
||||
|
||||
var _moduleTransformations = _interopRequireDefault(require("./module-transformations"));
|
||||
var _moduleTransformations = require("./module-transformations");
|
||||
|
||||
var _normalizeOptions = _interopRequireDefault(require("./normalize-options"));
|
||||
var _normalizeOptions = require("./normalize-options");
|
||||
|
||||
var _shippedProposals = require("../data/shipped-proposals");
|
||||
var _shippedProposals = require("./shipped-proposals");
|
||||
|
||||
var _pluginsCompatData = require("./plugins-compat-data");
|
||||
|
||||
var _overlappingPlugins = _interopRequireDefault(require("@babel/compat-data/overlapping-plugins"));
|
||||
var _overlappingPlugins = require("@babel/compat-data/overlapping-plugins");
|
||||
|
||||
var _usagePlugin = _interopRequireDefault(require("./polyfills/corejs2/usage-plugin"));
|
||||
var _regenerator = require("./polyfills/regenerator");
|
||||
|
||||
var _usagePlugin2 = _interopRequireDefault(require("./polyfills/corejs3/usage-plugin"));
|
||||
var _babelPolyfill = require("./polyfills/babel-polyfill");
|
||||
|
||||
var _usagePlugin3 = _interopRequireDefault(require("./polyfills/regenerator/usage-plugin"));
|
||||
var _babelPluginPolyfillCorejs = require("babel-plugin-polyfill-corejs2");
|
||||
|
||||
var _entryPlugin = _interopRequireDefault(require("./polyfills/corejs2/entry-plugin"));
|
||||
var _babelPluginPolyfillCorejs2 = require("babel-plugin-polyfill-corejs3");
|
||||
|
||||
var _entryPlugin2 = _interopRequireDefault(require("./polyfills/corejs3/entry-plugin"));
|
||||
var _babelPluginPolyfillRegenerator = require("babel-plugin-polyfill-regenerator");
|
||||
|
||||
var _entryPlugin3 = _interopRequireDefault(require("./polyfills/regenerator/entry-plugin"));
|
||||
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
|
||||
|
||||
var _helperCompilationTargets = _interopRequireWildcard(require("@babel/helper-compilation-targets"));
|
||||
|
||||
var _availablePlugins = _interopRequireDefault(require("./available-plugins"));
|
||||
|
||||
var _utils = require("./utils");
|
||||
var _availablePlugins = require("./available-plugins");
|
||||
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
const pluginCoreJS2 = _babelPluginPolyfillCorejs.default || _babelPluginPolyfillCorejs;
|
||||
const pluginCoreJS3 = _babelPluginPolyfillCorejs2.default || _babelPluginPolyfillCorejs2;
|
||||
const pluginRegenerator = _babelPluginPolyfillRegenerator.default || _babelPluginPolyfillRegenerator;
|
||||
|
||||
function isPluginRequired(targets, support) {
|
||||
return (0, _helperCompilationTargets.isRequired)("fake-name", targets, {
|
||||
@@ -58,14 +53,24 @@ function isPluginRequired(targets, support) {
|
||||
});
|
||||
}
|
||||
|
||||
function filterStageFromList(list, stageList) {
|
||||
return Object.keys(list).reduce((result, item) => {
|
||||
if (!stageList.has(item)) {
|
||||
result[item] = list[item];
|
||||
}
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
}
|
||||
|
||||
const pluginLists = {
|
||||
withProposals: {
|
||||
withoutBugfixes: _pluginsCompatData.plugins,
|
||||
withBugfixes: Object.assign({}, _pluginsCompatData.plugins, _pluginsCompatData.pluginsBugfixes)
|
||||
},
|
||||
withoutProposals: {
|
||||
withoutBugfixes: (0, _utils.filterStageFromList)(_pluginsCompatData.plugins, _shippedProposals.proposalPlugins),
|
||||
withBugfixes: (0, _utils.filterStageFromList)(Object.assign({}, _pluginsCompatData.plugins, _pluginsCompatData.pluginsBugfixes), _shippedProposals.proposalPlugins)
|
||||
withoutBugfixes: filterStageFromList(_pluginsCompatData.plugins, _shippedProposals.proposalPlugins),
|
||||
withBugfixes: filterStageFromList(Object.assign({}, _pluginsCompatData.plugins, _pluginsCompatData.pluginsBugfixes), _shippedProposals.proposalPlugins)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -78,7 +83,7 @@ function getPluginList(proposals, bugfixes) {
|
||||
}
|
||||
|
||||
const getPlugin = pluginName => {
|
||||
const plugin = _availablePlugins.default[pluginName];
|
||||
const plugin = _availablePlugins.default[pluginName]();
|
||||
|
||||
if (!plugin) {
|
||||
throw new Error(`Could not find plugin "${pluginName}". Ensure there is an entry in ./available-plugins.js for it.`);
|
||||
@@ -106,6 +111,7 @@ const getModulesPluginNames = ({
|
||||
transformations,
|
||||
shouldTransformESM,
|
||||
shouldTransformDynamicImport,
|
||||
shouldTransformExportNamespaceFrom,
|
||||
shouldParseTopLevelAwait
|
||||
}) => {
|
||||
const modulesPluginNames = [];
|
||||
@@ -128,6 +134,12 @@ const getModulesPluginNames = ({
|
||||
modulesPluginNames.push("syntax-dynamic-import");
|
||||
}
|
||||
|
||||
if (shouldTransformExportNamespaceFrom) {
|
||||
modulesPluginNames.push("proposal-export-namespace-from");
|
||||
} else {
|
||||
modulesPluginNames.push("syntax-export-namespace-from");
|
||||
}
|
||||
|
||||
if (shouldParseTopLevelAwait) {
|
||||
modulesPluginNames.push("syntax-top-level-await");
|
||||
}
|
||||
@@ -152,35 +164,47 @@ const getPolyfillPlugins = ({
|
||||
|
||||
if (useBuiltIns === "usage" || useBuiltIns === "entry") {
|
||||
const pluginOptions = {
|
||||
corejs,
|
||||
polyfillTargets,
|
||||
method: `${useBuiltIns}-global`,
|
||||
version: corejs ? corejs.toString() : undefined,
|
||||
targets: polyfillTargets,
|
||||
include,
|
||||
exclude,
|
||||
proposals,
|
||||
shippedProposals,
|
||||
regenerator,
|
||||
debug
|
||||
};
|
||||
|
||||
if (corejs) {
|
||||
if (useBuiltIns === "usage") {
|
||||
if (corejs.major === 2) {
|
||||
polyfillPlugins.push([_usagePlugin.default, pluginOptions]);
|
||||
polyfillPlugins.push([pluginCoreJS2, pluginOptions], [_babelPolyfill.default, {
|
||||
usage: true
|
||||
}]);
|
||||
} else {
|
||||
polyfillPlugins.push([_usagePlugin2.default, pluginOptions]);
|
||||
polyfillPlugins.push([pluginCoreJS3, pluginOptions], [_babelPolyfill.default, {
|
||||
usage: true,
|
||||
deprecated: true
|
||||
}]);
|
||||
}
|
||||
|
||||
if (regenerator) {
|
||||
polyfillPlugins.push([_usagePlugin3.default, pluginOptions]);
|
||||
polyfillPlugins.push([pluginRegenerator, {
|
||||
method: "usage-global",
|
||||
debug
|
||||
}]);
|
||||
}
|
||||
} else {
|
||||
if (corejs.major === 2) {
|
||||
polyfillPlugins.push([_entryPlugin.default, pluginOptions]);
|
||||
polyfillPlugins.push([_babelPolyfill.default, {
|
||||
regenerator
|
||||
}], [pluginCoreJS2, pluginOptions]);
|
||||
} else {
|
||||
polyfillPlugins.push([_entryPlugin2.default, pluginOptions]);
|
||||
polyfillPlugins.push([pluginCoreJS3, pluginOptions], [_babelPolyfill.default, {
|
||||
deprecated: true
|
||||
}]);
|
||||
|
||||
if (!regenerator) {
|
||||
polyfillPlugins.push([_entryPlugin3.default, pluginOptions]);
|
||||
polyfillPlugins.push([_regenerator.default, pluginOptions]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,20 +216,40 @@ const getPolyfillPlugins = ({
|
||||
|
||||
exports.getPolyfillPlugins = getPolyfillPlugins;
|
||||
|
||||
function getLocalTargets(optionsTargets, ignoreBrowserslistConfig, configPath, browserslistEnv) {
|
||||
if (optionsTargets != null && optionsTargets.esmodules && optionsTargets.browsers) {
|
||||
console.warn(`
|
||||
@babel/preset-env: esmodules and browsers targets have been specified together.
|
||||
\`browsers\` target, \`${optionsTargets.browsers.toString()}\` will be ignored.
|
||||
`);
|
||||
}
|
||||
|
||||
return (0, _helperCompilationTargets.default)(optionsTargets, {
|
||||
ignoreBrowserslistConfig,
|
||||
configPath,
|
||||
browserslistEnv
|
||||
});
|
||||
}
|
||||
|
||||
function supportsStaticESM(caller) {
|
||||
return !!(caller == null ? void 0 : caller.supportsStaticESM);
|
||||
return !!(caller != null && caller.supportsStaticESM);
|
||||
}
|
||||
|
||||
function supportsDynamicImport(caller) {
|
||||
return !!(caller == null ? void 0 : caller.supportsDynamicImport);
|
||||
return !!(caller != null && caller.supportsDynamicImport);
|
||||
}
|
||||
|
||||
function supportsExportNamespaceFrom(caller) {
|
||||
return !!(caller != null && caller.supportsExportNamespaceFrom);
|
||||
}
|
||||
|
||||
function supportsTopLevelAwait(caller) {
|
||||
return !!(caller == null ? void 0 : caller.supportsTopLevelAwait);
|
||||
return !!(caller != null && caller.supportsTopLevelAwait);
|
||||
}
|
||||
|
||||
var _default = (0, _helperPluginUtils.declare)((api, opts) => {
|
||||
var _default = (0, _helperPluginUtils.declarePreset)((api, opts) => {
|
||||
api.assertVersion(7);
|
||||
const babelTargets = api.targets();
|
||||
const {
|
||||
bugfixes,
|
||||
configPath,
|
||||
@@ -226,43 +270,51 @@ var _default = (0, _helperPluginUtils.declare)((api, opts) => {
|
||||
},
|
||||
browserslistEnv
|
||||
} = (0, _normalizeOptions.default)(opts);
|
||||
let hasUglifyTarget = false;
|
||||
let targets = babelTargets;
|
||||
|
||||
if (optionsTargets == null ? void 0 : optionsTargets.uglify) {
|
||||
hasUglifyTarget = true;
|
||||
delete optionsTargets.uglify;
|
||||
console.log("");
|
||||
console.log("The uglify target has been deprecated. Set the top level");
|
||||
console.log("option `forceAllTransforms: true` instead.");
|
||||
console.log("");
|
||||
if (_semver.lt(api.version, "7.13.0") || opts.targets || opts.configPath || opts.browserslistEnv || opts.ignoreBrowserslistConfig) {
|
||||
{
|
||||
var hasUglifyTarget = false;
|
||||
|
||||
if (optionsTargets != null && optionsTargets.uglify) {
|
||||
hasUglifyTarget = true;
|
||||
delete optionsTargets.uglify;
|
||||
console.warn(`
|
||||
The uglify target has been deprecated. Set the top level
|
||||
option \`forceAllTransforms: true\` instead.
|
||||
`);
|
||||
}
|
||||
}
|
||||
targets = getLocalTargets(optionsTargets, ignoreBrowserslistConfig, configPath, browserslistEnv);
|
||||
}
|
||||
|
||||
if ((optionsTargets == null ? void 0 : optionsTargets.esmodules) && optionsTargets.browsers) {
|
||||
console.log("");
|
||||
console.log("@babel/preset-env: esmodules and browsers targets have been specified together.");
|
||||
console.log(`\`browsers\` target, \`${optionsTargets.browsers}\` will be ignored.`);
|
||||
console.log("");
|
||||
}
|
||||
|
||||
const targets = (0, _helperCompilationTargets.default)(optionsTargets, {
|
||||
ignoreBrowserslistConfig,
|
||||
configPath,
|
||||
browserslistEnv
|
||||
});
|
||||
const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;
|
||||
const include = transformIncludesAndExcludes(optionsInclude);
|
||||
const exclude = transformIncludesAndExcludes(optionsExclude);
|
||||
const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;
|
||||
const compatData = getPluginList(shippedProposals, bugfixes);
|
||||
const shouldSkipExportNamespaceFrom = modules === "auto" && (api.caller == null ? void 0 : api.caller(supportsExportNamespaceFrom)) || modules === false && !(0, _helperCompilationTargets.isRequired)("proposal-export-namespace-from", transformTargets, {
|
||||
compatData,
|
||||
includes: include.plugins,
|
||||
excludes: exclude.plugins
|
||||
});
|
||||
const modulesPluginNames = getModulesPluginNames({
|
||||
modules,
|
||||
transformations: _moduleTransformations.default,
|
||||
shouldTransformESM: modules !== "auto" || !(api.caller == null ? void 0 : api.caller(supportsStaticESM)),
|
||||
shouldTransformDynamicImport: modules !== "auto" || !(api.caller == null ? void 0 : api.caller(supportsDynamicImport)),
|
||||
shouldTransformESM: modules !== "auto" || !(api.caller != null && api.caller(supportsStaticESM)),
|
||||
shouldTransformDynamicImport: modules !== "auto" || !(api.caller != null && api.caller(supportsDynamicImport)),
|
||||
shouldTransformExportNamespaceFrom: !shouldSkipExportNamespaceFrom,
|
||||
shouldParseTopLevelAwait: !api.caller || api.caller(supportsTopLevelAwait)
|
||||
});
|
||||
const pluginNames = (0, _helperCompilationTargets.filterItems)(getPluginList(shippedProposals, bugfixes), include.plugins, exclude.plugins, transformTargets, modulesPluginNames, (0, _getOptionSpecificExcludes.default)({
|
||||
const pluginNames = (0, _helperCompilationTargets.filterItems)(compatData, include.plugins, exclude.plugins, transformTargets, modulesPluginNames, (0, _getOptionSpecificExcludes.default)({
|
||||
loose
|
||||
}), _shippedProposals.pluginSyntaxMap);
|
||||
(0, _filterItems.removeUnnecessaryItems)(pluginNames, _overlappingPlugins.default);
|
||||
(0, _filterItems.removeUnnecessaryItems)(pluginNames, _overlappingPlugins);
|
||||
(0, _filterItems.removeUnsupportedItems)(pluginNames, api.version);
|
||||
|
||||
if (shippedProposals) {
|
||||
(0, _filterItems.addProposalSyntaxPlugins)(pluginNames, _shippedProposals.proposalSyntaxPlugins);
|
||||
}
|
||||
|
||||
const polyfillPlugins = getPolyfillPlugins({
|
||||
useBuiltIns,
|
||||
corejs,
|
||||
@@ -296,13 +348,11 @@ var _default = (0, _helperPluginUtils.declare)((api, opts) => {
|
||||
console.log(`\nUsing modules transform: ${modules.toString()}`);
|
||||
console.log("\nUsing plugins:");
|
||||
pluginNames.forEach(pluginName => {
|
||||
(0, _debug.logPluginOrPolyfill)(pluginName, targets, _pluginsCompatData.plugins);
|
||||
(0, _debug.logPlugin)(pluginName, targets, compatData);
|
||||
});
|
||||
|
||||
if (!useBuiltIns) {
|
||||
console.log("\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.");
|
||||
} else {
|
||||
console.log(`\nUsing polyfills with \`${useBuiltIns}\` option:`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-80
@@ -3,45 +3,31 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.normalizeCoreJSOption = normalizeCoreJSOption;
|
||||
exports.checkDuplicateIncludeExcludes = void 0;
|
||||
exports.default = normalizeOptions;
|
||||
exports.validateUseBuiltInsOption = exports.validateModulesOption = exports.validateIgnoreBrowserslistConfig = exports.validateStringOption = exports.validateBoolOption = exports.validateConfigPathOption = exports.checkDuplicateIncludeExcludes = exports.normalizePluginName = void 0;
|
||||
|
||||
var _data = _interopRequireDefault(require("core-js-compat/data"));
|
||||
|
||||
var _levenary = _interopRequireDefault(require("levenary"));
|
||||
|
||||
var _invariant = _interopRequireDefault(require("invariant"));
|
||||
exports.normalizeCoreJSOption = normalizeCoreJSOption;
|
||||
exports.validateUseBuiltInsOption = exports.validateModulesOption = exports.normalizePluginName = void 0;
|
||||
|
||||
var _semver = require("semver");
|
||||
|
||||
var _corejs2BuiltIns = _interopRequireDefault(require("@babel/compat-data/corejs2-built-ins"));
|
||||
var _corejs2BuiltIns = require("@babel/compat-data/corejs2-built-ins");
|
||||
|
||||
var _coreJsCompat = require("../data/core-js-compat");
|
||||
|
||||
var _pluginsCompatData = require("./plugins-compat-data");
|
||||
|
||||
var _moduleTransformations = _interopRequireDefault(require("./module-transformations"));
|
||||
var _moduleTransformations = require("./module-transformations");
|
||||
|
||||
var _options = require("./options");
|
||||
|
||||
var _getPlatformSpecificDefault = require("./polyfills/corejs2/get-platform-specific-default");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const validateTopLevelOptions = options => {
|
||||
const validOptions = Object.keys(_options.TopLevelOptions);
|
||||
|
||||
for (const option in options) {
|
||||
if (!_options.TopLevelOptions[option]) {
|
||||
throw new Error(`Invalid Option: ${option} is not a valid top-level option.
|
||||
Maybe you meant to use '${(0, _levenary.default)(option, validOptions)}'?`);
|
||||
}
|
||||
}
|
||||
};
|
||||
var _helperValidatorOption = require("@babel/helper-validator-option");
|
||||
|
||||
const corejs2DefaultWebIncludes = ["web.timers", "web.immediate", "web.dom.iterable"];
|
||||
const v = new _helperValidatorOption.OptionValidator("@babel/preset-env");
|
||||
const allPluginsList = Object.keys(_pluginsCompatData.plugins);
|
||||
const modulePlugins = ["proposal-dynamic-import", ...Object.keys(_moduleTransformations.default).map(m => _moduleTransformations.default[m])];
|
||||
|
||||
const getValidIncludesAndExcludes = (type, corejs) => new Set([...allPluginsList, ...(type === "exclude" ? modulePlugins : []), ...(corejs ? corejs == 2 ? [...Object.keys(_corejs2BuiltIns.default), ..._getPlatformSpecificDefault.defaultWebIncludes] : Object.keys(_data.default) : [])]);
|
||||
const getValidIncludesAndExcludes = (type, corejs) => new Set([...allPluginsList, ...(type === "exclude" ? modulePlugins : []), ...(corejs ? corejs == 2 ? [...Object.keys(_corejs2BuiltIns), ...corejs2DefaultWebIncludes] : Object.keys(_coreJsCompat) : [])]);
|
||||
|
||||
const pluginToRegExp = plugin => {
|
||||
if (plugin instanceof RegExp) return plugin;
|
||||
@@ -61,7 +47,7 @@ const expandIncludesAndExcludes = (plugins = [], type, corejs) => {
|
||||
if (plugins.length === 0) return [];
|
||||
const selectedPlugins = plugins.map(plugin => selectPlugins(pluginToRegExp(plugin), type, corejs));
|
||||
const invalidRegExpList = plugins.filter((p, i) => selectedPlugins[i].length === 0);
|
||||
(0, _invariant.default)(invalidRegExpList.length === 0, `Invalid Option: The plugins/built-ins '${invalidRegExpList.join(", ")}' passed to the '${type}' option are not
|
||||
v.invariant(invalidRegExpList.length === 0, `The plugins/built-ins '${invalidRegExpList.join(", ")}' passed to the '${type}' option are not
|
||||
valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env`);
|
||||
return flatten(selectedPlugins);
|
||||
};
|
||||
@@ -72,7 +58,7 @@ exports.normalizePluginName = normalizePluginName;
|
||||
|
||||
const checkDuplicateIncludeExcludes = (include = [], exclude = []) => {
|
||||
const duplicates = include.filter(opt => exclude.indexOf(opt) >= 0);
|
||||
(0, _invariant.default)(duplicates.length === 0, `Invalid Option: The plugins/built-ins '${duplicates.join(", ")}' were found in both the "include" and
|
||||
v.invariant(duplicates.length === 0, `The plugins/built-ins '${duplicates.join(", ")}' were found in both the "include" and
|
||||
"exclude" options.`);
|
||||
};
|
||||
|
||||
@@ -88,52 +74,15 @@ const normalizeTargets = targets => {
|
||||
return Object.assign({}, targets);
|
||||
};
|
||||
|
||||
const validateConfigPathOption = (configPath = process.cwd()) => {
|
||||
(0, _invariant.default)(typeof configPath === "string", `Invalid Option: The configPath option '${configPath}' is invalid, only strings are allowed.`);
|
||||
return configPath;
|
||||
};
|
||||
|
||||
exports.validateConfigPathOption = validateConfigPathOption;
|
||||
|
||||
const validateBoolOption = (name, value, defaultValue) => {
|
||||
if (typeof value === "undefined") {
|
||||
value = defaultValue;
|
||||
}
|
||||
|
||||
if (typeof value !== "boolean") {
|
||||
throw new Error(`Preset env: '${name}' option must be a boolean.`);
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
exports.validateBoolOption = validateBoolOption;
|
||||
|
||||
const validateStringOption = (name, value, defaultValue) => {
|
||||
if (typeof value === "undefined") {
|
||||
value = defaultValue;
|
||||
} else if (typeof value !== "string") {
|
||||
throw new Error(`Preset env: '${name}' option must be a string.`);
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
exports.validateStringOption = validateStringOption;
|
||||
|
||||
const validateIgnoreBrowserslistConfig = ignoreBrowserslistConfig => validateBoolOption(_options.TopLevelOptions.ignoreBrowserslistConfig, ignoreBrowserslistConfig, false);
|
||||
|
||||
exports.validateIgnoreBrowserslistConfig = validateIgnoreBrowserslistConfig;
|
||||
|
||||
const validateModulesOption = (modulesOpt = _options.ModulesOption.auto) => {
|
||||
(0, _invariant.default)(_options.ModulesOption[modulesOpt.toString()] || modulesOpt === _options.ModulesOption.false, `Invalid Option: The 'modules' option must be one of \n` + ` - 'false' to indicate no module processing\n` + ` - a specific module type: 'commonjs', 'amd', 'umd', 'systemjs'` + ` - 'auto' (default) which will automatically select 'false' if the current\n` + ` process is known to support ES module syntax, or "commonjs" otherwise\n`);
|
||||
v.invariant(_options.ModulesOption[modulesOpt.toString()] || modulesOpt === _options.ModulesOption.false, `The 'modules' option must be one of \n` + ` - 'false' to indicate no module processing\n` + ` - a specific module type: 'commonjs', 'amd', 'umd', 'systemjs'` + ` - 'auto' (default) which will automatically select 'false' if the current\n` + ` process is known to support ES module syntax, or "commonjs" otherwise\n`);
|
||||
return modulesOpt;
|
||||
};
|
||||
|
||||
exports.validateModulesOption = validateModulesOption;
|
||||
|
||||
const validateUseBuiltInsOption = (builtInsOpt = false) => {
|
||||
(0, _invariant.default)(_options.UseBuiltInsOption[builtInsOpt.toString()] || builtInsOpt === _options.UseBuiltInsOption.false, `Invalid Option: The 'useBuiltIns' option must be either
|
||||
v.invariant(_options.UseBuiltInsOption[builtInsOpt.toString()] || builtInsOpt === _options.UseBuiltInsOption.false, `The 'useBuiltIns' option must be either
|
||||
'false' (default) to indicate no polyfill,
|
||||
'"entry"' to indicate replacing the entry polyfill, or
|
||||
'"usage"' to import only used polyfills per file`);
|
||||
@@ -148,7 +97,7 @@ function normalizeCoreJSOption(corejs, useBuiltIns) {
|
||||
|
||||
if (useBuiltIns && corejs === undefined) {
|
||||
rawVersion = 2;
|
||||
console.warn("\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a " + "core-js version. Currently, we assume version 2.x when no version " + "is passed. Since this default version will likely change in future " + "versions of Babel, we recommend explicitly setting the core-js version " + "you are using via the `corejs` option.\n" + "\nYou should also be sure that the version you pass to the `corejs` " + "option matches the version specified in your `package.json`'s " + "`dependencies` section. If it doesn't, you need to run one of the " + "following commands:\n\n" + " npm install --save core-js@2 npm install --save core-js@3\n" + " yarn add core-js@2 yarn add core-js@3\n");
|
||||
console.warn("\nWARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a " + "core-js version. Currently, we assume version 2.x when no version " + "is passed. Since this default version will likely change in future " + "versions of Babel, we recommend explicitly setting the core-js version " + "you are using via the `corejs` option.\n" + "\nYou should also be sure that the version you pass to the `corejs` " + "option matches the version specified in your `package.json`'s " + "`dependencies` section. If it doesn't, you need to run one of the " + "following commands:\n\n" + " npm install --save core-js@2 npm install --save core-js@3\n" + " yarn add core-js@2 yarn add core-js@3\n\n" + "More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins\n" + "More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs");
|
||||
} else if (typeof corejs === "object" && corejs !== null) {
|
||||
rawVersion = corejs.version;
|
||||
proposals = Boolean(corejs.proposals);
|
||||
@@ -156,10 +105,10 @@ function normalizeCoreJSOption(corejs, useBuiltIns) {
|
||||
rawVersion = corejs;
|
||||
}
|
||||
|
||||
const version = rawVersion ? (0, _semver.coerce)(String(rawVersion)) : false;
|
||||
const version = rawVersion ? _semver.coerce(String(rawVersion)) : false;
|
||||
|
||||
if (!useBuiltIns && version) {
|
||||
console.log("\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n");
|
||||
console.warn("\nWARNING (@babel/preset-env): The `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n");
|
||||
}
|
||||
|
||||
if (useBuiltIns && (!version || version.major < 2 || version.major > 3)) {
|
||||
@@ -173,28 +122,27 @@ function normalizeCoreJSOption(corejs, useBuiltIns) {
|
||||
}
|
||||
|
||||
function normalizeOptions(opts) {
|
||||
validateTopLevelOptions(opts);
|
||||
v.validateTopLevelOptions(opts, _options.TopLevelOptions);
|
||||
const useBuiltIns = validateUseBuiltInsOption(opts.useBuiltIns);
|
||||
const corejs = normalizeCoreJSOption(opts.corejs, useBuiltIns);
|
||||
const include = expandIncludesAndExcludes(opts.include, _options.TopLevelOptions.include, !!corejs.version && corejs.version.major);
|
||||
const exclude = expandIncludesAndExcludes(opts.exclude, _options.TopLevelOptions.exclude, !!corejs.version && corejs.version.major);
|
||||
checkDuplicateIncludeExcludes(include, exclude);
|
||||
const shippedProposals = validateBoolOption(_options.TopLevelOptions.shippedProposals, opts.shippedProposals, false);
|
||||
return {
|
||||
bugfixes: validateBoolOption(_options.TopLevelOptions.bugfixes, opts.bugfixes, false),
|
||||
configPath: validateConfigPathOption(opts.configPath),
|
||||
bugfixes: v.validateBooleanOption(_options.TopLevelOptions.bugfixes, opts.bugfixes, false),
|
||||
configPath: v.validateStringOption(_options.TopLevelOptions.configPath, opts.configPath, process.cwd()),
|
||||
corejs,
|
||||
debug: validateBoolOption(_options.TopLevelOptions.debug, opts.debug, false),
|
||||
debug: v.validateBooleanOption(_options.TopLevelOptions.debug, opts.debug, false),
|
||||
include,
|
||||
exclude,
|
||||
forceAllTransforms: validateBoolOption(_options.TopLevelOptions.forceAllTransforms, opts.forceAllTransforms, false),
|
||||
ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(opts.ignoreBrowserslistConfig),
|
||||
loose: validateBoolOption(_options.TopLevelOptions.loose, opts.loose, false),
|
||||
forceAllTransforms: v.validateBooleanOption(_options.TopLevelOptions.forceAllTransforms, opts.forceAllTransforms, false),
|
||||
ignoreBrowserslistConfig: v.validateBooleanOption(_options.TopLevelOptions.ignoreBrowserslistConfig, opts.ignoreBrowserslistConfig, false),
|
||||
loose: v.validateBooleanOption(_options.TopLevelOptions.loose, opts.loose),
|
||||
modules: validateModulesOption(opts.modules),
|
||||
shippedProposals,
|
||||
spec: validateBoolOption(_options.TopLevelOptions.spec, opts.spec, false),
|
||||
shippedProposals: v.validateBooleanOption(_options.TopLevelOptions.shippedProposals, opts.shippedProposals, false),
|
||||
spec: v.validateBooleanOption(_options.TopLevelOptions.spec, opts.spec, false),
|
||||
targets: normalizeTargets(opts.targets),
|
||||
useBuiltIns: useBuiltIns,
|
||||
browserslistEnv: validateStringOption(_options.TopLevelOptions.browserslistEnv, opts.browserslistEnv)
|
||||
browserslistEnv: v.validateStringOption(_options.TopLevelOptions.browserslistEnv, opts.browserslistEnv)
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.UseBuiltInsOption = exports.ModulesOption = exports.TopLevelOptions = void 0;
|
||||
exports.UseBuiltInsOption = exports.TopLevelOptions = exports.ModulesOption = void 0;
|
||||
const TopLevelOptions = {
|
||||
bugfixes: "bugfixes",
|
||||
configPath: "configPath",
|
||||
|
||||
+8
-12
@@ -5,29 +5,25 @@ Object.defineProperty(exports, "__esModule", {
|
||||
});
|
||||
exports.pluginsBugfixes = exports.plugins = void 0;
|
||||
|
||||
var _plugins = _interopRequireDefault(require("@babel/compat-data/plugins"));
|
||||
var _plugins = require("@babel/compat-data/plugins");
|
||||
|
||||
var _pluginBugfixes = _interopRequireDefault(require("@babel/compat-data/plugin-bugfixes"));
|
||||
var _pluginBugfixes = require("@babel/compat-data/plugin-bugfixes");
|
||||
|
||||
var _availablePlugins = _interopRequireDefault(require("./available-plugins"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
var _availablePlugins = require("./available-plugins");
|
||||
|
||||
const pluginsFiltered = {};
|
||||
exports.plugins = pluginsFiltered;
|
||||
const bugfixPluginsFiltered = {};
|
||||
exports.pluginsBugfixes = bugfixPluginsFiltered;
|
||||
|
||||
for (const plugin of Object.keys(_plugins.default)) {
|
||||
for (const plugin of Object.keys(_plugins)) {
|
||||
if (Object.hasOwnProperty.call(_availablePlugins.default, plugin)) {
|
||||
pluginsFiltered[plugin] = _plugins.default[plugin];
|
||||
pluginsFiltered[plugin] = _plugins[plugin];
|
||||
}
|
||||
}
|
||||
|
||||
for (const plugin of Object.keys(_pluginBugfixes.default)) {
|
||||
for (const plugin of Object.keys(_pluginBugfixes)) {
|
||||
if (Object.hasOwnProperty.call(_availablePlugins.default, plugin)) {
|
||||
bugfixPluginsFiltered[plugin] = _pluginBugfixes.default[plugin];
|
||||
bugfixPluginsFiltered[plugin] = _pluginBugfixes[plugin];
|
||||
}
|
||||
}
|
||||
|
||||
pluginsFiltered["proposal-class-properties"] = pluginsFiltered["proposal-private-methods"];
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
const BABEL_POLYFILL_DEPRECATION = `
|
||||
\`@babel/polyfill\` is deprecated. Please, use required parts of \`core-js\`
|
||||
and \`regenerator-runtime/runtime\` separately`;
|
||||
const NO_DIRECT_POLYFILL_IMPORT = `
|
||||
When setting \`useBuiltIns: 'usage'\`, polyfills are automatically imported when needed.
|
||||
Please remove the direct import of \`SPECIFIER\` or use \`useBuiltIns: 'entry'\` instead.`;
|
||||
|
||||
function _default({
|
||||
template
|
||||
}, {
|
||||
regenerator,
|
||||
deprecated,
|
||||
usage
|
||||
}) {
|
||||
return {
|
||||
name: "preset-env/replace-babel-polyfill",
|
||||
visitor: {
|
||||
ImportDeclaration(path) {
|
||||
const src = (0, _utils.getImportSource)(path);
|
||||
|
||||
if (usage && (0, _utils.isPolyfillSource)(src)) {
|
||||
console.warn(NO_DIRECT_POLYFILL_IMPORT.replace("SPECIFIER", src));
|
||||
if (!deprecated) path.remove();
|
||||
} else if (src === "@babel/polyfill") {
|
||||
if (deprecated) {
|
||||
console.warn(BABEL_POLYFILL_DEPRECATION);
|
||||
} else if (regenerator) {
|
||||
path.replaceWithMultiple(template.ast`
|
||||
import "core-js";
|
||||
import "regenerator-runtime/runtime.js";
|
||||
`);
|
||||
} else {
|
||||
path.replaceWith(template.ast`
|
||||
import "core-js";
|
||||
`);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Program(path) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
const src = (0, _utils.getRequireSource)(bodyPath);
|
||||
|
||||
if (usage && (0, _utils.isPolyfillSource)(src)) {
|
||||
console.warn(NO_DIRECT_POLYFILL_IMPORT.replace("SPECIFIER", src));
|
||||
if (!deprecated) bodyPath.remove();
|
||||
} else if (src === "@babel/polyfill") {
|
||||
if (deprecated) {
|
||||
console.warn(BABEL_POLYFILL_DEPRECATION);
|
||||
} else if (regenerator) {
|
||||
bodyPath.replaceWithMultiple(template.ast`
|
||||
require("core-js");
|
||||
require("regenerator-runtime/runtime.js");
|
||||
`);
|
||||
} else {
|
||||
bodyPath.replaceWith(template.ast`
|
||||
require("core-js");
|
||||
`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
function isRegeneratorSource(source) {
|
||||
return source === "regenerator-runtime/runtime" || source === "regenerator-runtime/runtime.js";
|
||||
}
|
||||
|
||||
function _default() {
|
||||
const visitor = {
|
||||
ImportDeclaration(path) {
|
||||
if (isRegeneratorSource((0, _utils.getImportSource)(path))) {
|
||||
this.regeneratorImportExcluded = true;
|
||||
path.remove();
|
||||
}
|
||||
},
|
||||
|
||||
Program(path) {
|
||||
path.get("body").forEach(bodyPath => {
|
||||
if (isRegeneratorSource((0, _utils.getRequireSource)(bodyPath))) {
|
||||
this.regeneratorImportExcluded = true;
|
||||
bodyPath.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
return {
|
||||
name: "preset-env/remove-regenerator",
|
||||
visitor,
|
||||
|
||||
pre() {
|
||||
this.regeneratorImportExcluded = false;
|
||||
},
|
||||
|
||||
post() {
|
||||
if (this.opts.debug && this.regeneratorImportExcluded) {
|
||||
let filename = this.file.opts.filename;
|
||||
|
||||
if (process.env.BABEL_ENV === "test") {
|
||||
filename = filename.replace(/\\/g, "/");
|
||||
}
|
||||
|
||||
console.log(`\n[${filename}] Based on your targets, regenerator-runtime import excluded.`);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getImportSource = getImportSource;
|
||||
exports.getRequireSource = getRequireSource;
|
||||
exports.isPolyfillSource = isPolyfillSource;
|
||||
|
||||
var _t = require("@babel/types");
|
||||
|
||||
const {
|
||||
isCallExpression,
|
||||
isExpressionStatement,
|
||||
isIdentifier,
|
||||
isStringLiteral
|
||||
} = _t;
|
||||
|
||||
function getImportSource({
|
||||
node
|
||||
}) {
|
||||
if (node.specifiers.length === 0) return node.source.value;
|
||||
}
|
||||
|
||||
function getRequireSource({
|
||||
node
|
||||
}) {
|
||||
if (!isExpressionStatement(node)) return;
|
||||
const {
|
||||
expression
|
||||
} = node;
|
||||
|
||||
if (isCallExpression(expression) && isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && isStringLiteral(expression.arguments[0])) {
|
||||
return expression.arguments[0].value;
|
||||
}
|
||||
}
|
||||
|
||||
function isPolyfillSource(source) {
|
||||
return source === "@babel/polyfill" || source === "core-js";
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.proposalSyntaxPlugins = exports.proposalPlugins = exports.pluginSyntaxMap = void 0;
|
||||
const proposalPlugins = new Set();
|
||||
exports.proposalPlugins = proposalPlugins;
|
||||
const proposalSyntaxPlugins = ["syntax-import-assertions"];
|
||||
exports.proposalSyntaxPlugins = proposalSyntaxPlugins;
|
||||
const pluginSyntaxObject = {
|
||||
"proposal-async-generator-functions": "syntax-async-generators",
|
||||
"proposal-class-properties": "syntax-class-properties",
|
||||
"proposal-class-static-block": "syntax-class-static-block",
|
||||
"proposal-json-strings": "syntax-json-strings",
|
||||
"proposal-nullish-coalescing-operator": "syntax-nullish-coalescing-operator",
|
||||
"proposal-numeric-separator": "syntax-numeric-separator",
|
||||
"proposal-object-rest-spread": "syntax-object-rest-spread",
|
||||
"proposal-optional-catch-binding": "syntax-optional-catch-binding",
|
||||
"proposal-optional-chaining": "syntax-optional-chaining",
|
||||
"proposal-private-methods": "syntax-class-properties",
|
||||
"proposal-private-property-in-object": "syntax-private-property-in-object",
|
||||
"proposal-unicode-property-regex": null
|
||||
};
|
||||
const pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) {
|
||||
return [key, pluginSyntaxObject[key]];
|
||||
});
|
||||
const pluginSyntaxMap = new Map(pluginSyntaxEntries);
|
||||
exports.pluginSyntaxMap = pluginSyntaxMap;
|
||||
+1
-11
@@ -15,15 +15,5 @@ Object.defineProperty(exports, "isBrowsersQueryValid", {
|
||||
return _helperCompilationTargets.isBrowsersQueryValid;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "semverMin", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperCompilationTargets.semverMin;
|
||||
}
|
||||
});
|
||||
|
||||
var _helperCompilationTargets = _interopRequireWildcard(require("@babel/helper-compilation-targets"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
|
||||
Reference in New Issue
Block a user