orange-tailor-85423
10/19/2018, 11:56 PMwhite-balloon-205
creamy-potato-29402
10/20/2018, 1:58 AMrough-oil-1458
10/21/2018, 12:57 AMorange-tailor-85423
10/22/2018, 12:02 AMglamorous-printer-66548
10/22/2018, 2:58 AMimport something from './something'
but don’t actually use any of the imported symbols in the file where you import it (i.e. in this case the symbol is something
) or you’re only importing a type, but not a value, the generated runtime code will not load the module, even if you have specified the import. This is kind of an implicit dead code / unused import removal.
If you want to import a file just for it’s side-effects, without using any of it’s exported symbols, you have to write simply:
import './something'
. This will always load the module.
Here’s a bit more info on that behaviour: https://github.com/Microsoft/TypeScript/wiki/FAQ#why-are-imports-being-elided-in-my-emit