Next.jsとwebpackでのインポートを楽にする

動機 他の階層のモジュールを相対パスでインポートすると、見辛いし、パスが変更した時に書き換えが大変ですよね import Hoge from '../../../components/templates/Hoge' なので、下記のようにしたい。 import Hoge from '~/components/templates/Hoge' 結論 まずは、next.config.js のwebpackの設定でconfig.resolve.ali…