Skip to content

Commit

Permalink
fix: Don't set corejs for runtime (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
taion committed Mar 20, 2019
1 parent 4f88aee commit b7e7200
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/babel-preset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const intlPreset = require('./intl-preset');

const PRESET_ENV_OPTIONS = [
'configPath',
'corejs',
'debug',
'exclude',
'forceAllTransforms',
Expand Down Expand Up @@ -50,14 +49,12 @@ function addDefaultOptions(explicitOptions) {
explicitOptions,
);

if (options.useBuiltIns && !options.corejs) {
// Stay with core-js v2.x for now.
options.corejs = 2;
}
// By default, stay with core-js v2.x for now.
options.envCorejs = options.corejs || 2;

if (!options.exclude) {
options.exclude =
options.corejs === 2
options.envCorejs === 2
? [
// Seems to be added by default with minimum benefit.
'web.dom.iterable',
Expand Down Expand Up @@ -121,7 +118,13 @@ function preset(api, explicitOptions = {}) {
}

const presets = [
[envPreset, pick(options, PRESET_ENV_OPTIONS)],
[
envPreset,
{
...pick(options, PRESET_ENV_OPTIONS),
corejs: options.envCorejs,
},
],
[reactPreset, { development }],
];

Expand Down

0 comments on commit b7e7200

Please sign in to comment.