Ensure import() is not transpiled in babel-core published source (#11974)

* fix: Ensure `import()` is not transpiled when published

* Update packages/babel-core/test/config-chain.js [skip ci]
This commit is contained in:
Huáng Jùnliàng
2020-08-20 13:31:26 -04:00
committed by GitHub
parent 84ea6e4501
commit 4be67fb19a
5 changed files with 100 additions and 25 deletions

View File

@@ -69,7 +69,14 @@ function buildBabel(exclude, sourcesGlob = defaultSourcesGlob) {
.pipe(errorsLogger())
.pipe(newer({ dest: base, map: swapSrcWithLib }))
.pipe(compilationLogger())
.pipe(babel())
.pipe(
babel({
caller: {
// We have wrapped packages/babel-core/src/config/files/configuration.js with feature detection
supportsDynamicImport: true,
},
})
)
.pipe(
// Passing 'file.relative' because newer() above uses a relative
// path and this keeps it consistent.