LoginSignup
0
0

More than 1 year has passed since last update.

Path Intellisenseでnext.jsのファイルパス保管が効くようにする

Posted at

next.jsで下記のように絶対パスでimportできるようになったのですが、VSCodeの初期設定だとファイルパスを保管してくれません…

import React from 'react';
import CustomAppBar from '/components/uiParts/CustomAppBar';

設定方法

Path Intellisenseをインストール後、
jsconfig.jsonをおいて、paths設定してあげるとPath Intellisenseでも保管ができるようになります。

jsconfig.json
{
    "compilerOptions": {
        "baseUrl": ".",
        "paths": {
            "/*": [
                "./*"
            ]
        }
    }
}

VSCode拡張

Path Intellisense - Visual Studio Marketplace
https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense

こんなかんじ

スクリーンショット 2021-08-02 16.08.58.png

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