Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (envCache.has(key)) {
return envCache.get(key);
}
const options = {
targets,
modules: false,
useBuiltIns: useBuiltIns ? 'entry' : false,
shippedProposals: true,
};
if (useBuiltIns) {
options.corejs = 2;
}
let plugins = presetEnv.default({assertVersion: () => true}, options).plugins;
envCache.set(key, plugins);
return plugins;
}
module.exports = function buildSkpmPreset(api, options) {
const transpileTargets =
(options && options.targets) || buildTargets(options || {})
const debug =
options && typeof options.debug === 'boolean' ? !!options.debug : false
return {
presets: [
require('@babel/preset-env').default(api, {
debug,
modules: false,
targets: transpileTargets,
}),
require('@babel/preset-react'),
],
plugins: [
'@babel/plugin-syntax-async-generators',
'@babel/plugin-proposal-object-rest-spread',
],
}
}