Fix @babel/env modules config (#5119)

Probably an oversight but currently env preset's `modules` option always evaluates to 'auto'. We probably want it to be set to false, especially in prod, to have Webpack handle modules natively.
This commit is contained in:
Julia Qiu 2018-09-07 02:42:10 -07:00 committed by Tim Neutkens
parent 48c48975c4
commit a9b1383b5d

View file

@ -33,7 +33,7 @@ module.exports = (context, opts = {}) => ({
[require('@babel/preset-env').default, {
// In the test environment `modules` is often needed to be set to true, babel figures that out by itself using the `'auto'` option
// In production/development this option is set to `false` so that webpack can handle import/export with tree-shaking
modules: isDevelopment && isProduction ? false : 'auto',
modules: isDevelopment || isProduction ? false : 'auto',
...opts['preset-env']
}],
[require('@babel/preset-react'), {