mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-05 23:52:18 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
219
web/node_modules/@babel/preset-env/lib/available-plugins.js
generated
vendored
Normal file
219
web/node_modules/@babel/preset-env/lib/available-plugins.js
generated
vendored
Normal file
|
@ -0,0 +1,219 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.minVersions = exports.default = void 0;
|
||||
|
||||
var _pluginSyntaxAsyncGenerators = require("@babel/plugin-syntax-async-generators");
|
||||
|
||||
var _pluginSyntaxClassProperties = require("@babel/plugin-syntax-class-properties");
|
||||
|
||||
var _pluginSyntaxClassStaticBlock = require("@babel/plugin-syntax-class-static-block");
|
||||
|
||||
var _pluginSyntaxDynamicImport = require("@babel/plugin-syntax-dynamic-import");
|
||||
|
||||
var _pluginSyntaxExportNamespaceFrom = require("@babel/plugin-syntax-export-namespace-from");
|
||||
|
||||
var _pluginSyntaxJsonStrings = require("@babel/plugin-syntax-json-strings");
|
||||
|
||||
var _pluginSyntaxLogicalAssignmentOperators = require("@babel/plugin-syntax-logical-assignment-operators");
|
||||
|
||||
var _pluginSyntaxNullishCoalescingOperator = require("@babel/plugin-syntax-nullish-coalescing-operator");
|
||||
|
||||
var _pluginSyntaxNumericSeparator = require("@babel/plugin-syntax-numeric-separator");
|
||||
|
||||
var _pluginSyntaxObjectRestSpread = require("@babel/plugin-syntax-object-rest-spread");
|
||||
|
||||
var _pluginSyntaxOptionalCatchBinding = require("@babel/plugin-syntax-optional-catch-binding");
|
||||
|
||||
var _pluginSyntaxOptionalChaining = require("@babel/plugin-syntax-optional-chaining");
|
||||
|
||||
var _pluginSyntaxPrivatePropertyInObject = require("@babel/plugin-syntax-private-property-in-object");
|
||||
|
||||
var _pluginSyntaxTopLevelAwait = require("@babel/plugin-syntax-top-level-await");
|
||||
|
||||
var _pluginProposalAsyncGeneratorFunctions = require("@babel/plugin-proposal-async-generator-functions");
|
||||
|
||||
var _pluginProposalClassProperties = require("@babel/plugin-proposal-class-properties");
|
||||
|
||||
var _pluginProposalClassStaticBlock = require("@babel/plugin-proposal-class-static-block");
|
||||
|
||||
var _pluginProposalDynamicImport = require("@babel/plugin-proposal-dynamic-import");
|
||||
|
||||
var _pluginProposalExportNamespaceFrom = require("@babel/plugin-proposal-export-namespace-from");
|
||||
|
||||
var _pluginProposalJsonStrings = require("@babel/plugin-proposal-json-strings");
|
||||
|
||||
var _pluginProposalLogicalAssignmentOperators = require("@babel/plugin-proposal-logical-assignment-operators");
|
||||
|
||||
var _pluginProposalNullishCoalescingOperator = require("@babel/plugin-proposal-nullish-coalescing-operator");
|
||||
|
||||
var _pluginProposalNumericSeparator = require("@babel/plugin-proposal-numeric-separator");
|
||||
|
||||
var _pluginProposalObjectRestSpread = require("@babel/plugin-proposal-object-rest-spread");
|
||||
|
||||
var _pluginProposalOptionalCatchBinding = require("@babel/plugin-proposal-optional-catch-binding");
|
||||
|
||||
var _pluginProposalOptionalChaining = require("@babel/plugin-proposal-optional-chaining");
|
||||
|
||||
var _pluginProposalPrivateMethods = require("@babel/plugin-proposal-private-methods");
|
||||
|
||||
var _pluginProposalPrivatePropertyInObject = require("@babel/plugin-proposal-private-property-in-object");
|
||||
|
||||
var _pluginProposalUnicodePropertyRegex = require("@babel/plugin-proposal-unicode-property-regex");
|
||||
|
||||
var _pluginTransformAsyncToGenerator = require("@babel/plugin-transform-async-to-generator");
|
||||
|
||||
var _pluginTransformArrowFunctions = require("@babel/plugin-transform-arrow-functions");
|
||||
|
||||
var _pluginTransformBlockScopedFunctions = require("@babel/plugin-transform-block-scoped-functions");
|
||||
|
||||
var _pluginTransformBlockScoping = require("@babel/plugin-transform-block-scoping");
|
||||
|
||||
var _pluginTransformClasses = require("@babel/plugin-transform-classes");
|
||||
|
||||
var _pluginTransformComputedProperties = require("@babel/plugin-transform-computed-properties");
|
||||
|
||||
var _pluginTransformDestructuring = require("@babel/plugin-transform-destructuring");
|
||||
|
||||
var _pluginTransformDotallRegex = require("@babel/plugin-transform-dotall-regex");
|
||||
|
||||
var _pluginTransformDuplicateKeys = require("@babel/plugin-transform-duplicate-keys");
|
||||
|
||||
var _pluginTransformExponentiationOperator = require("@babel/plugin-transform-exponentiation-operator");
|
||||
|
||||
var _pluginTransformForOf = require("@babel/plugin-transform-for-of");
|
||||
|
||||
var _pluginTransformFunctionName = require("@babel/plugin-transform-function-name");
|
||||
|
||||
var _pluginTransformLiterals = require("@babel/plugin-transform-literals");
|
||||
|
||||
var _pluginTransformMemberExpressionLiterals = require("@babel/plugin-transform-member-expression-literals");
|
||||
|
||||
var _pluginTransformModulesAmd = require("@babel/plugin-transform-modules-amd");
|
||||
|
||||
var _pluginTransformModulesCommonjs = require("@babel/plugin-transform-modules-commonjs");
|
||||
|
||||
var _pluginTransformModulesSystemjs = require("@babel/plugin-transform-modules-systemjs");
|
||||
|
||||
var _pluginTransformModulesUmd = require("@babel/plugin-transform-modules-umd");
|
||||
|
||||
var _pluginTransformNamedCapturingGroupsRegex = require("@babel/plugin-transform-named-capturing-groups-regex");
|
||||
|
||||
var _pluginTransformNewTarget = require("@babel/plugin-transform-new-target");
|
||||
|
||||
var _pluginTransformObjectSuper = require("@babel/plugin-transform-object-super");
|
||||
|
||||
var _pluginTransformParameters = require("@babel/plugin-transform-parameters");
|
||||
|
||||
var _pluginTransformPropertyLiterals = require("@babel/plugin-transform-property-literals");
|
||||
|
||||
var _pluginTransformRegenerator = require("@babel/plugin-transform-regenerator");
|
||||
|
||||
var _pluginTransformReservedWords = require("@babel/plugin-transform-reserved-words");
|
||||
|
||||
var _pluginTransformShorthandProperties = require("@babel/plugin-transform-shorthand-properties");
|
||||
|
||||
var _pluginTransformSpread = require("@babel/plugin-transform-spread");
|
||||
|
||||
var _pluginTransformStickyRegex = require("@babel/plugin-transform-sticky-regex");
|
||||
|
||||
var _pluginTransformTemplateLiterals = require("@babel/plugin-transform-template-literals");
|
||||
|
||||
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 _pluginBugfixV8SpreadParametersInOptionalChaining = require("@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining");
|
||||
|
||||
var _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-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.default,
|
||||
"syntax-dynamic-import": () => _pluginSyntaxDynamicImport,
|
||||
"syntax-export-namespace-from": () => _pluginSyntaxExportNamespaceFrom,
|
||||
"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.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
|
||||
};
|
||||
exports.default = _default;
|
||||
const minVersions = {
|
||||
"proposal-class-static-block": "7.12.0",
|
||||
"proposal-private-property-in-object": "7.10.0"
|
||||
};
|
||||
exports.minVersions = minVersions;
|
33
web/node_modules/@babel/preset-env/lib/debug.js
generated
vendored
Normal file
33
web/node_modules/@babel/preset-env/lib/debug.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.logPlugin = void 0;
|
||||
|
||||
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
|
||||
|
||||
const logPlugin = (item, targetVersions, list) => {
|
||||
const filteredList = (0, _helperCompilationTargets.getInclusionReasons)(item, targetVersions, list);
|
||||
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.logPlugin = logPlugin;
|
29
web/node_modules/@babel/preset-env/lib/filter-items.js
generated
vendored
Normal file
29
web/node_modules/@babel/preset-env/lib/filter-items.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.removeUnnecessaryItems = removeUnnecessaryItems;
|
||||
exports.removeUnsupportedItems = removeUnsupportedItems;
|
||||
|
||||
var _semver = require("semver");
|
||||
|
||||
var _availablePlugins = require("./available-plugins");
|
||||
|
||||
const has = Function.call.bind(Object.hasOwnProperty);
|
||||
|
||||
function removeUnnecessaryItems(items, overlapping) {
|
||||
items.forEach(item => {
|
||||
var _overlapping$item;
|
||||
|
||||
(_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) && (0, _semver.lt)(babelVersion, _availablePlugins.minVersions[item])) {
|
||||
items.delete(item);
|
||||
}
|
||||
});
|
||||
}
|
13
web/node_modules/@babel/preset-env/lib/get-option-specific-excludes.js
generated
vendored
Normal file
13
web/node_modules/@babel/preset-env/lib/get-option-specific-excludes.js
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
const defaultExcludesForLooseMode = ["transform-typeof-symbol"];
|
||||
|
||||
function _default({
|
||||
loose
|
||||
}) {
|
||||
return loose ? defaultExcludesForLooseMode : null;
|
||||
}
|
358
web/node_modules/@babel/preset-env/lib/index.js
generated
vendored
Normal file
358
web/node_modules/@babel/preset-env/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,358 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isPluginRequired = isPluginRequired;
|
||||
exports.default = exports.getPolyfillPlugins = exports.getModulesPluginNames = exports.transformIncludesAndExcludes = void 0;
|
||||
|
||||
var _semver = require("semver");
|
||||
|
||||
var _debug = require("./debug");
|
||||
|
||||
var _getOptionSpecificExcludes = require("./get-option-specific-excludes");
|
||||
|
||||
var _filterItems = require("./filter-items");
|
||||
|
||||
var _moduleTransformations = require("./module-transformations");
|
||||
|
||||
var _normalizeOptions = require("./normalize-options");
|
||||
|
||||
var _shippedProposals = require("../data/shipped-proposals");
|
||||
|
||||
var _pluginsCompatData = require("./plugins-compat-data");
|
||||
|
||||
var _overlappingPlugins = require("@babel/compat-data/overlapping-plugins");
|
||||
|
||||
var _regenerator = require("./polyfills/regenerator");
|
||||
|
||||
var _babelPolyfill = require("./polyfills/babel-polyfill");
|
||||
|
||||
var _babelPluginPolyfillCorejs = require("babel-plugin-polyfill-corejs2");
|
||||
|
||||
var _babelPluginPolyfillCorejs2 = require("babel-plugin-polyfill-corejs3");
|
||||
|
||||
var _babelPluginPolyfillRegenerator = require("babel-plugin-polyfill-regenerator");
|
||||
|
||||
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
|
||||
|
||||
var _availablePlugins = require("./available-plugins");
|
||||
|
||||
var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
||||
|
||||
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, {
|
||||
compatData: {
|
||||
"fake-name": 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: filterStageFromList(_pluginsCompatData.plugins, _shippedProposals.proposalPlugins),
|
||||
withBugfixes: filterStageFromList(Object.assign({}, _pluginsCompatData.plugins, _pluginsCompatData.pluginsBugfixes), _shippedProposals.proposalPlugins)
|
||||
}
|
||||
};
|
||||
|
||||
function getPluginList(proposals, bugfixes) {
|
||||
if (proposals) {
|
||||
if (bugfixes) return pluginLists.withProposals.withBugfixes;else return pluginLists.withProposals.withoutBugfixes;
|
||||
} else {
|
||||
if (bugfixes) return pluginLists.withoutProposals.withBugfixes;else return pluginLists.withoutProposals.withoutBugfixes;
|
||||
}
|
||||
}
|
||||
|
||||
const getPlugin = 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.`);
|
||||
}
|
||||
|
||||
return plugin;
|
||||
};
|
||||
|
||||
const transformIncludesAndExcludes = opts => {
|
||||
return opts.reduce((result, opt) => {
|
||||
const target = opt.match(/^(es|es6|es7|esnext|web)\./) ? "builtIns" : "plugins";
|
||||
result[target].add(opt);
|
||||
return result;
|
||||
}, {
|
||||
all: opts,
|
||||
plugins: new Set(),
|
||||
builtIns: new Set()
|
||||
});
|
||||
};
|
||||
|
||||
exports.transformIncludesAndExcludes = transformIncludesAndExcludes;
|
||||
|
||||
const getModulesPluginNames = ({
|
||||
modules,
|
||||
transformations,
|
||||
shouldTransformESM,
|
||||
shouldTransformDynamicImport,
|
||||
shouldTransformExportNamespaceFrom,
|
||||
shouldParseTopLevelAwait
|
||||
}) => {
|
||||
const modulesPluginNames = [];
|
||||
|
||||
if (modules !== false && transformations[modules]) {
|
||||
if (shouldTransformESM) {
|
||||
modulesPluginNames.push(transformations[modules]);
|
||||
}
|
||||
|
||||
if (shouldTransformDynamicImport && shouldTransformESM && modules !== "umd") {
|
||||
modulesPluginNames.push("proposal-dynamic-import");
|
||||
} else {
|
||||
if (shouldTransformDynamicImport) {
|
||||
console.warn("Dynamic import can only be supported when transforming ES modules" + " to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.");
|
||||
}
|
||||
|
||||
modulesPluginNames.push("syntax-dynamic-import");
|
||||
}
|
||||
} else {
|
||||
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");
|
||||
}
|
||||
|
||||
return modulesPluginNames;
|
||||
};
|
||||
|
||||
exports.getModulesPluginNames = getModulesPluginNames;
|
||||
|
||||
const getPolyfillPlugins = ({
|
||||
useBuiltIns,
|
||||
corejs,
|
||||
polyfillTargets,
|
||||
include,
|
||||
exclude,
|
||||
proposals,
|
||||
shippedProposals,
|
||||
regenerator,
|
||||
debug
|
||||
}) => {
|
||||
const polyfillPlugins = [];
|
||||
|
||||
if (useBuiltIns === "usage" || useBuiltIns === "entry") {
|
||||
const pluginOptions = {
|
||||
method: `${useBuiltIns}-global`,
|
||||
version: corejs ? corejs.toString() : undefined,
|
||||
targets: polyfillTargets,
|
||||
include,
|
||||
exclude,
|
||||
proposals,
|
||||
shippedProposals,
|
||||
debug
|
||||
};
|
||||
|
||||
if (corejs) {
|
||||
if (useBuiltIns === "usage") {
|
||||
if (corejs.major === 2) {
|
||||
polyfillPlugins.push([pluginCoreJS2, pluginOptions], [_babelPolyfill.default, {
|
||||
usage: true
|
||||
}]);
|
||||
} else {
|
||||
polyfillPlugins.push([pluginCoreJS3, pluginOptions], [_babelPolyfill.default, {
|
||||
usage: true,
|
||||
deprecated: true
|
||||
}]);
|
||||
}
|
||||
|
||||
if (regenerator) {
|
||||
polyfillPlugins.push([pluginRegenerator, {
|
||||
method: "usage-global",
|
||||
debug
|
||||
}]);
|
||||
}
|
||||
} else {
|
||||
if (corejs.major === 2) {
|
||||
polyfillPlugins.push([_babelPolyfill.default, {
|
||||
regenerator
|
||||
}], [pluginCoreJS2, pluginOptions]);
|
||||
} else {
|
||||
polyfillPlugins.push([pluginCoreJS3, pluginOptions], [_babelPolyfill.default, {
|
||||
deprecated: true
|
||||
}]);
|
||||
|
||||
if (!regenerator) {
|
||||
polyfillPlugins.push([_regenerator.default, pluginOptions]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return polyfillPlugins;
|
||||
};
|
||||
|
||||
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 && caller.supportsStaticESM);
|
||||
}
|
||||
|
||||
function supportsDynamicImport(caller) {
|
||||
return !!(caller != null && caller.supportsDynamicImport);
|
||||
}
|
||||
|
||||
function supportsExportNamespaceFrom(caller) {
|
||||
return !!(caller != null && caller.supportsExportNamespaceFrom);
|
||||
}
|
||||
|
||||
function supportsTopLevelAwait(caller) {
|
||||
return !!(caller != null && caller.supportsTopLevelAwait);
|
||||
}
|
||||
|
||||
var _default = (0, _helperPluginUtils.declare)((api, opts) => {
|
||||
api.assertVersion(7);
|
||||
const babelTargets = api.targets();
|
||||
const {
|
||||
bugfixes,
|
||||
configPath,
|
||||
debug,
|
||||
exclude: optionsExclude,
|
||||
forceAllTransforms,
|
||||
ignoreBrowserslistConfig,
|
||||
include: optionsInclude,
|
||||
loose,
|
||||
modules,
|
||||
shippedProposals,
|
||||
spec,
|
||||
targets: optionsTargets,
|
||||
useBuiltIns,
|
||||
corejs: {
|
||||
version: corejs,
|
||||
proposals
|
||||
},
|
||||
browserslistEnv
|
||||
} = (0, _normalizeOptions.default)(opts);
|
||||
let targets = babelTargets;
|
||||
|
||||
if ((0, _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);
|
||||
}
|
||||
|
||||
const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;
|
||||
const include = transformIncludesAndExcludes(optionsInclude);
|
||||
const exclude = transformIncludesAndExcludes(optionsExclude);
|
||||
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 && 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)(compatData, include.plugins, exclude.plugins, transformTargets, modulesPluginNames, (0, _getOptionSpecificExcludes.default)({
|
||||
loose
|
||||
}), _shippedProposals.pluginSyntaxMap);
|
||||
(0, _filterItems.removeUnnecessaryItems)(pluginNames, _overlappingPlugins);
|
||||
(0, _filterItems.removeUnsupportedItems)(pluginNames, api.version);
|
||||
const polyfillPlugins = getPolyfillPlugins({
|
||||
useBuiltIns,
|
||||
corejs,
|
||||
polyfillTargets: targets,
|
||||
include: include.builtIns,
|
||||
exclude: exclude.builtIns,
|
||||
proposals,
|
||||
shippedProposals,
|
||||
regenerator: pluginNames.has("transform-regenerator"),
|
||||
debug
|
||||
});
|
||||
const pluginUseBuiltIns = useBuiltIns !== false;
|
||||
const plugins = Array.from(pluginNames).map(pluginName => {
|
||||
if (pluginName === "proposal-class-properties" || pluginName === "proposal-private-methods" || pluginName === "proposal-private-property-in-object") {
|
||||
return [getPlugin(pluginName), {
|
||||
loose: loose ? "#__internal__@babel/preset-env__prefer-true-but-false-is-ok-if-it-prevents-an-error" : "#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error"
|
||||
}];
|
||||
}
|
||||
|
||||
return [getPlugin(pluginName), {
|
||||
spec,
|
||||
loose,
|
||||
useBuiltIns: pluginUseBuiltIns
|
||||
}];
|
||||
}).concat(polyfillPlugins);
|
||||
|
||||
if (debug) {
|
||||
console.log("@babel/preset-env: `DEBUG` option");
|
||||
console.log("\nUsing targets:");
|
||||
console.log(JSON.stringify((0, _helperCompilationTargets.prettifyTargets)(targets), null, 2));
|
||||
console.log(`\nUsing modules transform: ${modules.toString()}`);
|
||||
console.log("\nUsing plugins:");
|
||||
pluginNames.forEach(pluginName => {
|
||||
(0, _debug.logPlugin)(pluginName, targets, compatData);
|
||||
});
|
||||
|
||||
if (!useBuiltIns) {
|
||||
console.log("\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.");
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
plugins
|
||||
};
|
||||
});
|
||||
|
||||
exports.default = _default;
|
15
web/node_modules/@babel/preset-env/lib/module-transformations.js
generated
vendored
Normal file
15
web/node_modules/@babel/preset-env/lib/module-transformations.js
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _default = {
|
||||
auto: "transform-modules-commonjs",
|
||||
amd: "transform-modules-amd",
|
||||
commonjs: "transform-modules-commonjs",
|
||||
cjs: "transform-modules-commonjs",
|
||||
systemjs: "transform-modules-systemjs",
|
||||
umd: "transform-modules-umd"
|
||||
};
|
||||
exports.default = _default;
|
147
web/node_modules/@babel/preset-env/lib/normalize-options.js
generated
vendored
Normal file
147
web/node_modules/@babel/preset-env/lib/normalize-options.js
generated
vendored
Normal file
|
@ -0,0 +1,147 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.normalizeCoreJSOption = normalizeCoreJSOption;
|
||||
exports.default = normalizeOptions;
|
||||
exports.validateUseBuiltInsOption = exports.validateModulesOption = exports.checkDuplicateIncludeExcludes = exports.normalizePluginName = void 0;
|
||||
|
||||
var _data = require("core-js-compat/data.json");
|
||||
|
||||
var _semver = require("semver");
|
||||
|
||||
var _corejs2BuiltIns = require("@babel/compat-data/corejs2-built-ins");
|
||||
|
||||
var _pluginsCompatData = require("./plugins-compat-data");
|
||||
|
||||
var _moduleTransformations = require("./module-transformations");
|
||||
|
||||
var _options = require("./options");
|
||||
|
||||
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), ...corejs2DefaultWebIncludes] : Object.keys(_data) : [])]);
|
||||
|
||||
const pluginToRegExp = plugin => {
|
||||
if (plugin instanceof RegExp) return plugin;
|
||||
|
||||
try {
|
||||
return new RegExp(`^${normalizePluginName(plugin)}$`);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
const selectPlugins = (regexp, type, corejs) => Array.from(getValidIncludesAndExcludes(type, corejs)).filter(item => regexp instanceof RegExp && regexp.test(item));
|
||||
|
||||
const flatten = array => [].concat(...array);
|
||||
|
||||
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);
|
||||
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);
|
||||
};
|
||||
|
||||
const normalizePluginName = plugin => plugin.replace(/^(@babel\/|babel-)(plugin-)?/, "");
|
||||
|
||||
exports.normalizePluginName = normalizePluginName;
|
||||
|
||||
const checkDuplicateIncludeExcludes = (include = [], exclude = []) => {
|
||||
const duplicates = include.filter(opt => exclude.indexOf(opt) >= 0);
|
||||
v.invariant(duplicates.length === 0, `The plugins/built-ins '${duplicates.join(", ")}' were found in both the "include" and
|
||||
"exclude" options.`);
|
||||
};
|
||||
|
||||
exports.checkDuplicateIncludeExcludes = checkDuplicateIncludeExcludes;
|
||||
|
||||
const normalizeTargets = targets => {
|
||||
if (typeof targets === "string" || Array.isArray(targets)) {
|
||||
return {
|
||||
browsers: targets
|
||||
};
|
||||
}
|
||||
|
||||
return Object.assign({}, targets);
|
||||
};
|
||||
|
||||
const validateModulesOption = (modulesOpt = _options.ModulesOption.auto) => {
|
||||
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) => {
|
||||
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`);
|
||||
return builtInsOpt;
|
||||
};
|
||||
|
||||
exports.validateUseBuiltInsOption = validateUseBuiltInsOption;
|
||||
|
||||
function normalizeCoreJSOption(corejs, useBuiltIns) {
|
||||
let proposals = false;
|
||||
let rawVersion;
|
||||
|
||||
if (useBuiltIns && corejs === undefined) {
|
||||
rawVersion = 2;
|
||||
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);
|
||||
} else {
|
||||
rawVersion = corejs;
|
||||
}
|
||||
|
||||
const version = rawVersion ? (0, _semver.coerce)(String(rawVersion)) : false;
|
||||
|
||||
if (!useBuiltIns && version) {
|
||||
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)) {
|
||||
throw new RangeError("Invalid Option: The version passed to `corejs` is invalid. Currently, " + "only core-js@2 and core-js@3 are supported.");
|
||||
}
|
||||
|
||||
return {
|
||||
version,
|
||||
proposals
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeOptions(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);
|
||||
return {
|
||||
bugfixes: v.validateBooleanOption(_options.TopLevelOptions.bugfixes, opts.bugfixes, false),
|
||||
configPath: v.validateStringOption(_options.TopLevelOptions.configPath, opts.configPath, process.cwd()),
|
||||
corejs,
|
||||
debug: v.validateBooleanOption(_options.TopLevelOptions.debug, opts.debug, false),
|
||||
include,
|
||||
exclude,
|
||||
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: v.validateBooleanOption(_options.TopLevelOptions.shippedProposals, opts.shippedProposals, false),
|
||||
spec: v.validateBooleanOption(_options.TopLevelOptions.spec, opts.spec, false),
|
||||
targets: normalizeTargets(opts.targets),
|
||||
useBuiltIns: useBuiltIns,
|
||||
browserslistEnv: v.validateStringOption(_options.TopLevelOptions.browserslistEnv, opts.browserslistEnv)
|
||||
};
|
||||
}
|
40
web/node_modules/@babel/preset-env/lib/options.js
generated
vendored
Normal file
40
web/node_modules/@babel/preset-env/lib/options.js
generated
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.UseBuiltInsOption = exports.ModulesOption = exports.TopLevelOptions = void 0;
|
||||
const TopLevelOptions = {
|
||||
bugfixes: "bugfixes",
|
||||
configPath: "configPath",
|
||||
corejs: "corejs",
|
||||
debug: "debug",
|
||||
exclude: "exclude",
|
||||
forceAllTransforms: "forceAllTransforms",
|
||||
ignoreBrowserslistConfig: "ignoreBrowserslistConfig",
|
||||
include: "include",
|
||||
loose: "loose",
|
||||
modules: "modules",
|
||||
shippedProposals: "shippedProposals",
|
||||
spec: "spec",
|
||||
targets: "targets",
|
||||
useBuiltIns: "useBuiltIns",
|
||||
browserslistEnv: "browserslistEnv"
|
||||
};
|
||||
exports.TopLevelOptions = TopLevelOptions;
|
||||
const ModulesOption = {
|
||||
false: false,
|
||||
auto: "auto",
|
||||
amd: "amd",
|
||||
commonjs: "commonjs",
|
||||
cjs: "cjs",
|
||||
systemjs: "systemjs",
|
||||
umd: "umd"
|
||||
};
|
||||
exports.ModulesOption = ModulesOption;
|
||||
const UseBuiltInsOption = {
|
||||
false: false,
|
||||
entry: "entry",
|
||||
usage: "usage"
|
||||
};
|
||||
exports.UseBuiltInsOption = UseBuiltInsOption;
|
31
web/node_modules/@babel/preset-env/lib/plugins-compat-data.js
generated
vendored
Normal file
31
web/node_modules/@babel/preset-env/lib/plugins-compat-data.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.pluginsBugfixes = exports.plugins = void 0;
|
||||
|
||||
var _plugins = require("@babel/compat-data/plugins");
|
||||
|
||||
var _pluginBugfixes = require("@babel/compat-data/plugin-bugfixes");
|
||||
|
||||
var _availablePlugins = require("./available-plugins");
|
||||
|
||||
const pluginsFiltered = {};
|
||||
exports.plugins = pluginsFiltered;
|
||||
const bugfixPluginsFiltered = {};
|
||||
exports.pluginsBugfixes = bugfixPluginsFiltered;
|
||||
|
||||
for (const plugin of Object.keys(_plugins)) {
|
||||
if (Object.hasOwnProperty.call(_availablePlugins.default, plugin)) {
|
||||
pluginsFiltered[plugin] = _plugins[plugin];
|
||||
}
|
||||
}
|
||||
|
||||
for (const plugin of Object.keys(_pluginBugfixes)) {
|
||||
if (Object.hasOwnProperty.call(_availablePlugins.default, plugin)) {
|
||||
bugfixPluginsFiltered[plugin] = _pluginBugfixes[plugin];
|
||||
}
|
||||
}
|
||||
|
||||
pluginsFiltered["proposal-class-properties"] = pluginsFiltered["proposal-private-methods"];
|
77
web/node_modules/@babel/preset-env/lib/polyfills/babel-polyfill.js
generated
vendored
Normal file
77
web/node_modules/@babel/preset-env/lib/polyfills/babel-polyfill.js
generated
vendored
Normal file
|
@ -0,0 +1,77 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _utils = require("./utils");
|
||||
|
||||
var t = require("@babel/types");
|
||||
|
||||
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
web/node_modules/@babel/preset-env/lib/polyfills/regenerator.js
generated
vendored
Normal file
54
web/node_modules/@babel/preset-env/lib/polyfills/regenerator.js
generated
vendored
Normal file
|
@ -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.`);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
33
web/node_modules/@babel/preset-env/lib/polyfills/utils.js
generated
vendored
Normal file
33
web/node_modules/@babel/preset-env/lib/polyfills/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getImportSource = getImportSource;
|
||||
exports.getRequireSource = getRequireSource;
|
||||
exports.isPolyfillSource = isPolyfillSource;
|
||||
|
||||
var t = require("@babel/types");
|
||||
|
||||
function getImportSource({
|
||||
node
|
||||
}) {
|
||||
if (node.specifiers.length === 0) return node.source.value;
|
||||
}
|
||||
|
||||
function getRequireSource({
|
||||
node
|
||||
}) {
|
||||
if (!t.isExpressionStatement(node)) return;
|
||||
const {
|
||||
expression
|
||||
} = node;
|
||||
|
||||
if (t.isCallExpression(expression) && t.isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && t.isStringLiteral(expression.arguments[0])) {
|
||||
return expression.arguments[0].value;
|
||||
}
|
||||
}
|
||||
|
||||
function isPolyfillSource(source) {
|
||||
return source === "@babel/polyfill" || source === "core-js";
|
||||
}
|
19
web/node_modules/@babel/preset-env/lib/targets-parser.js
generated
vendored
Normal file
19
web/node_modules/@babel/preset-env/lib/targets-parser.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperCompilationTargets.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "isBrowsersQueryValid", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _helperCompilationTargets.isBrowsersQueryValid;
|
||||
}
|
||||
});
|
||||
|
||||
var _helperCompilationTargets = require("@babel/helper-compilation-targets");
|
Loading…
Add table
Add a link
Reference in a new issue