# Real-World Scenarios — Babel and SWC: JavaScript Transpilation and Build Speed

Source: https://www.skillbyai.com/en/babel-swc/bs-interview-scenarios

> Practise real-world scenarios such as slow builds, missing polyfills and unchecked TypeScript errors.

## Scenario: Build time is too long

You have a large React project with 5000+ files. Babel transpilation takes 45 seconds on each build. How would you optimize? Answer: Consider SWC for 10-50x speedup, check if node_modules are excluded, enable Babel caching.

## Scenario: App works locally but breaks in IE11

Your app must support a browser that lacks Promise. Babel transpiles syntax, but Promise is a runtime feature. Solution: add `core-js` polyfills with `useBuiltIns: 'usage'` in the Babel config.

## Scenario: TypeScript project has no type checking

Your team uses TypeScript but Babel strips types silently. A colleague ships code with a typo in a property name — it compiles fine but crashes at runtime. Solution: Run `tsc --noEmit` in CI pipeline; add type checking to pre-commit hooks.
