When importing an interface or type alias, use import type { User } from './types';. This tells bundlers and TypeScript that the import is purely for compile-time checking and should be erased completely from the output JavaScript.
ADVERTISEMENT