I would like to use resolve.alias
feature from webpack in my projects using React Starter Kit.
For example:
Instead this:
import Component from '../../components/Component
I would like to use
import Component from 'components/Component
I've added this configuration on config.js
file:
resolve: {
alias: {
components: './src/components'
}
}
This resolve.alias
enables aliases for projects bundled with webpack but doesn't working with React Starter Kit.
You need to configure alias with the full path:
Instead of using alias, I usually use modules to "mount" my entire
src
folder:which, assuming I have a dir structure like:
let's me write these sorts of imports: