From f93d4ee184b3db8c57451b2fcb0420b35e7f2d65 Mon Sep 17 00:00:00 2001 From: Istvan Hevele Date: Thu, 17 Sep 2026 11:02:19 -0400 Subject: [PATCH] fix(deps): preserve type-only import elision under babel 8 Babel 8's preset-typescript defaults onlyRemoveTypeImports to true, so it only elides `import type {...}` and stops auto-detecting plain `import {...}` of type-only bindings. Files that import purely-typed bindings without the `type` keyword would otherwise get those imports left in the compiled output, breaking module resolution for any import pointing at a type-only module. Found and verified in ModaOperandi/tsconfigs#271 and ModaOperandi/vendor-portal-x#3455. Applying the same fix here defensively even though this repo's build didn't hit the failure mode, since it depends on which files use `import type` vs plain `import` for type-only bindings. Co-Authored-By: Claude Sonnet 5 --- babel.config.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)$/,