0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【TypeScript】IDEでTSのファイルをauto importする際に含まれるエイリアスを修正する方法【ts.config.json】

Posted at

ts.config.jsonのpathsを修正

tscongi.json
    "paths": {
      "~/*": [
        "./src/*"
      ],
      "@/*": [
        "./src/*"
      ],
    }

pathsは複数指定できるものの上から順に優先されて読み込まれる事と、webpack側でのエイリアスの設定と合っているかどうかに気をつけた方が良さそうです。

ちなみに、Next.jsを使用している場合は、ts.config.jsonを修正すれば自動でパスのエイリアスが設定できるみたいなので、webpack側のエイリアスの設定はNext.jsがよしなにやってくれていそうです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?