diff --git a/babel.config.js b/babel.config.js index 0e024073c..942937bef 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,12 @@ module.exports = { - presets: ['@babel/preset-env', '@babel/preset-typescript'], + presets: [ + '@babel/preset-env', + // Babel 8 defaults onlyRemoveTypeImports to true, so it only + // elides `import type {...}` and stops auto-detecting plain + // `import {...}` of type-only bindings, which can leave imports + // of type-only modules in the compiled output. + ['@babel/preset-typescript', { onlyRemoveTypeImports: false }] + ], overrides: [ { test: /\.(jsx|tsx)$/,