1
00:00:00,000 --> 00:00:04,600
I imported one TypeScript type.

2
00:00:04,600 --> 00:00:06,520
Why did the other file still run?

3
00:00:06,700 --> 00:00:09,890
With the verbatim module syntax setting

4
00:00:09,890 --> 00:00:12,360
on, that form removes the type name.

5
00:00:12,360 --> 00:00:14,940
It leaves an empty import in the JavaScript.

6
00:00:15,120 --> 00:00:18,320
Empty means no names are imported.

7
00:00:18,320 --> 00:00:21,320
It does not mean skip the file.

8
00:00:21,320 --> 00:00:24,160
JavaScript still runs that file’s top-level code.

9
00:00:24,160 --> 00:00:26,280
Here, it prints loaded.

10
00:00:26,460 --> 00:00:28,660
So how do I keep the

11
00:00:28,660 --> 00:00:31,620
type without loading that file?

12
00:00:31,800 --> 00:00:34,860
Put type before the braces.

13
00:00:34,860 --> 00:00:38,280
Now TypeScript removes the whole import.

14
00:00:38,280 --> 00:00:41,800
In our isolated test, loaded no longer prints.

15
00:00:41,980 --> 00:00:46,060
If you need its startup code, add a separate import.

16
00:00:46,060 --> 00:00:48,940
Other imports can still load the file.

17
00:00:48,940 --> 00:00:51,700
This test runs compiler output directly;

18
00:00:51,700 --> 00:00:53,740
a bundler adds another step.

19
00:00:53,920 --> 00:00:56,395
I asked for a name tag.

20
00:00:56,395 --> 00:00:58,800
The whole employee showed up.
