import Component from '../../../../components/component’. In fact import Component from '../../../../components/component' doesn’t import but search for it in the node_modules folder. This feature allows you to specify default root source for you JS files. As you already know that you need to install babel plugin for availing this feature we will see how to install the plugin. Run npm install command to install the plugin as given below.
npm install babel-plugin-root-import --save-dev
Then create a .babelrc in the root of your app and configure the settings as given below, you can modify the settings just as you want.