diff --git a/packages/babel-preset-app/src/index.js b/packages/babel-preset-app/src/index.js index afde81950e..3e4b0e8a44 100644 --- a/packages/babel-preset-app/src/index.js +++ b/packages/babel-preset-app/src/index.js @@ -47,7 +47,9 @@ module.exports = (context, options = {}) => { const presets = [] const plugins = [] - const modern = Boolean(options.modern) + const modern = options.modern === undefined + ? context.env('modern') + : Boolean(options.modern) const { polyfills: userPolyfills, diff --git a/packages/webpack/src/config/modern.js b/packages/webpack/src/config/modern.js index 8b406587e9..4c97013439 100644 --- a/packages/webpack/src/config/modern.js +++ b/packages/webpack/src/config/modern.js @@ -12,19 +12,4 @@ export default class WebpackModernConfig extends WebpackClientConfig { 'process.modern': true }) } - - getBabelOptions () { - return { - ...this.buildContext.buildOptions.babel, - envName: this.name, - presets: [ - [ - require.resolve('@nuxt/babel-preset-app'), - { - modern: true - } - ] - ] - } - } }