Created by: JLHwung
This PR removes modules: false
option and resorts to the defaults of @babel/preset-env
: { modules: "auto" }
.
See https://github.com/babel/website/pull/2301 for the differences between { modules: "auto" }
and { modules: false }
.
Since Babel 7.11 (https://github.com/babel/babel/pull/11849), { modules: false }
could result to unwanted behaviour when export * as ns
is used in test environment on Node 14, where Babel will skip proposal-export-ns-from
because Node 14 has native export * as ns
support but Webpack 4 will throw because it does not support export * as ns
.
When { modules: "auto" }
is specified, Babel will determine whether it should be transformed from the caller data passed by babel-loader
.
This change is not breaking change given that webpack 4 + babel-loader 8
used in CRA yields same results between modules: "auto"
and modules: false
.