Further tweak runtime plugin per documentation

This commit is contained in:
Joe Haddad
2018-09-20 11:26:33 -04:00
parent 054ba79ff6
commit c989b70b89

View File

@@ -107,12 +107,18 @@ module.exports = function(api, opts, env) {
useBuiltIns: true,
},
],
// Polyfills the runtime needed for async/await and generators
// Polyfills the runtime needed for async/await, generators, and friends
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
[
require('@babel/plugin-transform-runtime').default,
{
corejs: false,
helpers: false,
regenerator: true,
// https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
// We should turn this on once the lowest version of Node LTS
// supports ES Modules.
useESModules: isEnvDevelopment || isEnvProduction,
},
],
isEnvProduction && [