No, the asset-map:compile command does not perform any JavaScript transpilation or TypeScript compilation. This is actually a key design principle of Symfony's Asset Mapper component.
The Asset Mapper is built on the philosophy of using modern JavaScript that runs directly in browsers without needing transpilation. It relies on:
- Native ES modules (ESM)
- Modern JavaScript syntax that current browsers support
- Import maps for dependency resolution
Regarding TypeScript: Asset Mapper does not support TypeScript files out of the box. Since browsers cannot execute TypeScript directly, and Asset Mapper avoids build/transpilation steps, you cannot use .ts files with the standard Asset Mapper setup.
If you need TypeScript or transpilation features, you have a few options:
- Use a traditional build tool like Webpack Encore or Vite instead of Asset Mapper
- Pre-compile TypeScript separately before Asset Mapper processes the resulting JavaScript files (though this somewhat defeats the purpose of Asset Mapper's no-build approach)
- Stick to modern JavaScript that's compatible with your target browsers
The Asset Mapper is intentionally minimalist - it handles:
- Asset versioning and cache busting
- Import map generation for dependency management
- Copying and organizing assets
But it deliberately avoids:
- Transpilation (Babel, TypeScript, etc.)
- Bundling/minification
- CSS preprocessing (Sass, Less)
- Other build-time transformations
This makes it simpler and faster, but also means you need to write JavaScript that browsers can understand natively.