Skip to content

Commit

Permalink
Pass babel core version to preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Mar 16, 2021
1 parent da642ab commit 3ea0373
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/parcel-bundler/src/transforms/babel/env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const presetEnv = require('@babel/preset-env');
const getTargetEngines = require('../../utils/getTargetEngines');
const babelCore = require('@babel/core');

/**
* Generates a @babel/preset-env config for an asset.
Expand Down Expand Up @@ -59,7 +60,7 @@ async function getEnvPlugins(targets, useBuiltIns = false) {
options.corejs = 2;
}

let plugins = presetEnv.default({assertVersion: () => true}, options).plugins;
let plugins = presetEnv.default({version: babelCore.version, assertVersion: () => true}, options).plugins;

envCache.set(key, plugins);
return plugins;
Expand Down

0 comments on commit 3ea0373

Please sign in to comment.