mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-01 13:53:20 +00:00
fix: support babel corejs config for modern mode (#6070)
This commit is contained in:
parent
e4ad970584
commit
54cd68dbb0
@ -47,7 +47,9 @@ module.exports = (context, options = {}) => {
|
|||||||
const presets = []
|
const presets = []
|
||||||
const plugins = []
|
const plugins = []
|
||||||
|
|
||||||
const modern = Boolean(options.modern)
|
const modern = options.modern === undefined
|
||||||
|
? context.env('modern')
|
||||||
|
: Boolean(options.modern)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
polyfills: userPolyfills,
|
polyfills: userPolyfills,
|
||||||
|
@ -12,19 +12,4 @@ export default class WebpackModernConfig extends WebpackClientConfig {
|
|||||||
'process.modern': true
|
'process.modern': true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getBabelOptions () {
|
|
||||||
return {
|
|
||||||
...this.buildContext.buildOptions.babel,
|
|
||||||
envName: this.name,
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
require.resolve('@nuxt/babel-preset-app'),
|
|
||||||
{
|
|
||||||
modern: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user