'use strict'; var helperPluginUtils = require('@babel/helper-plugin-utils'); var proposalAsyncDoExpressions = require('@babel/plugin-proposal-async-do-expressions'); var proposalDestructuringPrivate = require('@babel/plugin-proposal-destructuring-private'); var proposalDoExpressions = require('@babel/plugin-proposal-do-expressions'); var proposalDuplicateNamedCapturingGroupsRegex = require('@babel/plugin-proposal-duplicate-named-capturing-groups-regex'); var proposalFunctionBind = require('@babel/plugin-proposal-function-bind'); var proposalFunctionSent = require('@babel/plugin-proposal-function-sent'); var proposalImportDefer = require('@babel/plugin-proposal-import-defer'); var proposalImportWasmSource = require('@babel/plugin-proposal-import-wasm-source'); var proposalOptionalChainingAssign = require('@babel/plugin-proposal-optional-chaining-assign'); var proposalPartialApplication = require('@babel/plugin-proposal-partial-application'); var proposalPipelineOperator = require('@babel/plugin-proposal-pipeline-operator'); var proposalRecordAndTuple = require('@babel/plugin-proposal-record-and-tuple'); var proposalRegexpModifiers = require('@babel/plugin-proposal-regexp-modifiers'); var proposalThrowExpression = require('@babel/plugin-proposal-throw-expressions'); var syntaxDecorators = require('@babel/plugin-syntax-decorators'); var syntaxTypeScript = require('@babel/plugin-syntax-typescript'); var transformModulesCommonjs = require('@babel/plugin-transform-modules-commonjs'); const [major, minor] = process.versions.node.split("."); const IS_RECORD_TUPLE_SUPPORTED = ( // eslint-disable-next-line no-magic-numbers +major > 14 || +major === 14 && +minor >= 6 ); var syntaxV8intrinsic = helperPluginUtils.declare((api) => { api.assertVersion(7); return { name: "v8intrinsic", manipulateOptions(_opts, parserOpts) { parserOpts.plugins.push("v8intrinsic"); } }; }); var index = helperPluginUtils.declare( (api, { decoratorsBeforeExport, decoratorsLegacy = true, importDefer, isTSX, pipelineOperator = "minimal", optionalChainingAssignVersion = "2023-07", recordTuplePolyfill = IS_RECORD_TUPLE_SUPPORTED, recordTupleSyntaxType = "hash" }) => { api.assertVersion(7); return { plugins: [ [ syntaxDecorators, { decoratorsBeforeExport, legacy: decoratorsLegacy } ], [ syntaxTypeScript, { isTSX } ], syntaxV8intrinsic, proposalAsyncDoExpressions, proposalDestructuringPrivate, proposalDuplicateNamedCapturingGroupsRegex, proposalDoExpressions, proposalFunctionBind, proposalFunctionSent, ...importDefer ? [proposalImportDefer, transformModulesCommonjs] : [], proposalPartialApplication, proposalImportWasmSource, [ proposalOptionalChainingAssign, { version: optionalChainingAssignVersion } ], [ proposalPipelineOperator, { proposal: pipelineOperator } ], recordTuplePolyfill && [ proposalRecordAndTuple, { importPolyfill: !!recordTuplePolyfill, polyfillModuleName: typeof recordTuplePolyfill === "string" ? recordTuplePolyfill : void 0, syntaxType: recordTupleSyntaxType } ], proposalRegexpModifiers, proposalThrowExpression ].filter(Boolean), // no need to override if it has been enabled overrides: isTSX ? void 0 : [ { test: /\.[jt]sx$/, plugins: [ [ syntaxTypeScript, { isTSX: true } ] ] } ] }; } ); module.exports = index;