Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
require('./node-polyfills');
var _only = [];
const PLUGINS = [
[require('@babel/plugin-transform-flow-strip-types').default],
[require('@babel/plugin-proposal-object-rest-spread').default],
[require('@babel/plugin-proposal-class-properties').default],
[require('@babel/plugin-transform-modules-commonjs').default],
[require('@babel/plugin-proposal-nullish-coalescing-operator').default],
[require('@babel/plugin-proposal-optional-catch-binding').default],
[require('@babel/plugin-proposal-optional-chaining').default],
];
if (/^v[0-7]\./.test(process.version)) {
PLUGINS.push([require('@babel/plugin-transform-async-to-generator').default]);
}
function registerOnly(onlyList) {
// This prevents `babel-register` from transforming the code of the
// plugins/presets that we are require-ing themselves before setting up the
// actual config.
require('@babel/register')({only: [], babelrc: false, configFile: false});
require('@babel/register')(config(onlyList));
}
function config(onlyList) {
_only = _only.concat(onlyList);
return {
babelrc: false,
configFile: false,
ignore: null,
require('./node-polyfills');
var _only = [];
const PLUGINS = [
[require('@babel/plugin-transform-flow-strip-types').default],
[require('@babel/plugin-proposal-object-rest-spread').default],
[require('@babel/plugin-proposal-class-properties').default],
[require('@babel/plugin-transform-modules-commonjs').default],
[require('@babel/plugin-proposal-nullish-coalescing-operator').default],
[require('@babel/plugin-proposal-optional-catch-binding').default],
[require('@babel/plugin-proposal-optional-chaining').default],
];
if (/^v[0-7]\./.test(process.version)) {
PLUGINS.push([require('@babel/plugin-transform-async-to-generator').default]);
}
function registerOnly(onlyList) {
// This prevents `babel-register` from transforming the code of the
// plugins/presets that we are require-ing themselves before setting up the
// actual config.
require('@babel/register')({only: [], babelrc: false});
require('@babel/register')(config(onlyList));
}
function config(onlyList) {
_only = _only.concat(onlyList);
return {
babelrc: false,
ignore: null,
only: _only,