mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(babel-preset-app): always transpile optional chaining and nullish-coalescing for server (#8203)
This commit is contained in:
parent
d9f48228fe
commit
c75ac80f36
@ -14,6 +14,8 @@
|
||||
"@babel/helper-compilation-targets": "^7.10.4",
|
||||
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
||||
"@babel/plugin-proposal-decorators": "^7.10.5",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
|
||||
"@babel/plugin-transform-runtime": "^7.11.5",
|
||||
"@babel/preset-env": "^7.11.5",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
|
@ -159,6 +159,12 @@ module.exports = (api, options = {}) => {
|
||||
absoluteRuntime
|
||||
}])
|
||||
|
||||
// https://github.com/nuxt/nuxt.js/issues/7722
|
||||
if (envName === 'server') {
|
||||
plugins.push(require('@babel/plugin-proposal-optional-chaining'))
|
||||
plugins.push(require('@babel/plugin-proposal-nullish-coalescing-operator'))
|
||||
}
|
||||
|
||||
return {
|
||||
sourceType: 'unambiguous',
|
||||
presets,
|
||||
|
Loading…
Reference in New Issue
Block a user