Better Module Imports With Webpack Aliases
import SomeComponent from '../components/SomeComponent.jsx';
The first is simply too long and the second is both ugly and brittle to changes in file location. This can all be resolved with a Webpack alias.
Webpack will use this
alias when resolving module imports like the
following updated example:
import SomeComponent from 'components/SomeComponent.jsx';
section of the Webpack docs for more details.
h/t Vidal EkechukwuTweet