generated at
Type-only imports and exports


type のみの import / export ができる
ts
import type { SomeThing } from "./some-module.js";
ts
export type { SomeThing };


v4.5のtype Modifiers on Import Namesで1行で書けるようになった
before.ts
import { Foo1 } from "foo"; import type { Foo2 } from "foo";
after.ts
import { Foo1, type Foo2 } from "foo";



通常は特に気にする必要はないっぽい
型も普通に imoprt で書けばいい
特定のtranspilerを使った時に import で書くと無理になるケースがあり、その時に import type が役立つらしい
いつ問題が起こるのか?
あんまりわからん #??
Webpackを使った時に起こるらしい