Asked By: Anonymous
I read code in an app with NextJS. It imports component like
import Head from '~/components/layout/head'
The project structure:
-app ---components ---pages ---public
I wonder where defines
~ as root dir in nextJS.
Where can I find the config of this?
Tried uncover the webpack config inside next package, but didn’t find.
Answered By: Anonymous
I find this is because the babel plugin
babel-plugin-root-import, since the project uses this plugin in babel config.
More about this plugin can check here.