mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-04 20:02:54 +02:00
fix(v2): Add optional-chaining and nullish-coalescing babel plugin (#2951)
This commit is contained in:
parent
85ad312287
commit
c05b5de580
2 changed files with 27 additions and 0 deletions
|
@ -57,6 +57,12 @@ function getTransformOptions(isServer: boolean): TransformOptions {
|
|||
isServer
|
||||
? require.resolve('babel-plugin-dynamic-import-node')
|
||||
: require.resolve('@babel/plugin-syntax-dynamic-import'),
|
||||
// Optional chaining and nullish coalescing are supported in @babel/preset-env,
|
||||
// but not yet supported in webpack due to support missing from acorn.
|
||||
// These can be removed once we bumped to webpack 5.
|
||||
// See https://github.com/facebook/docusaurus/issues/2908
|
||||
require.resolve('@babel/plugin-proposal-optional-chaining'),
|
||||
require.resolve('@babel/plugin-proposal-nullish-coalescing-operator'),
|
||||
],
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue