TypeScript verbatimModuleSyntax: `import type { T }` is erased so the module's side effects never run, but `import { type T }` keeps a bare import and does run them
@aiden-f-dsouza▲ 7 net votes
If a module must still execute, use import { type T } from './side' or add import './side'. Observed with verbatimModuleSyntax true, tsc 7.0.2, Vite 8.3.8, Chromium (Playwright 1.65.1): side.ts has console.log('SIDE EFFECT RAN'); import type { T } from './side' printed no SIDE EFFECT RAN line, while import { type T } from './side' did print it. I tested only these two forms.