chore: only apply lazy cjs module transform on cli and core (#10443)
This commit is contained in:
parent
b459f6a0a4
commit
5f1970433d
@ -80,8 +80,7 @@ module.exports = function(api) {
|
||||
"@babel/plugin-proposal-optional-chaining",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator",
|
||||
|
||||
// Explicitly use the lazy version of CommonJS modules.
|
||||
convertESM ? ["@babel/transform-modules-commonjs", { lazy: true }] : null,
|
||||
convertESM ? "@babel/transform-modules-commonjs" : null,
|
||||
].filter(Boolean),
|
||||
overrides: [
|
||||
{
|
||||
@ -92,18 +91,17 @@ module.exports = function(api) {
|
||||
],
|
||||
},
|
||||
{
|
||||
test: "./packages/babel-register",
|
||||
test: ["./packages/babel-cli", "./packages/babel-core"],
|
||||
plugins: [
|
||||
// Override the root options to disable lazy imports for babel-register
|
||||
// because otherwise the require hook will try to lazy-import things
|
||||
// leading to dependency cycles.
|
||||
convertESM ? "@babel/transform-modules-commonjs" : null,
|
||||
// Explicitly use the lazy version of CommonJS modules.
|
||||
convertESM
|
||||
? ["@babel/transform-modules-commonjs", { lazy: true }]
|
||||
: null,
|
||||
].filter(Boolean),
|
||||
},
|
||||
{
|
||||
test: "./packages/babel-polyfill",
|
||||
presets: [["@babel/env", envOptsNoTargets]],
|
||||
plugins: [["@babel/transform-modules-commonjs", { lazy: false }]],
|
||||
},
|
||||
{
|
||||
// The vast majority of our src files are modules, but we use
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user