As the app grows, managing the dependencies should be as simple and consistent as possible.
With complexity and multiple folders it can be tedious to travers through all the paths using relative references.
import Bar from '../../components/foo/Bar'
// Better
import Bar from 'components/foo/Bar'
````
This is super simple to do in Webpack.
Currently I create a config file looking like this:
```js
module.exports = {
chainWebpack: config => {
config.resolve.modules.add("./src");
}
};
Adding ./src to the default webpack config would make this easier for many people and prevent some errors for some developers as the path can always be used from the actual src folder.
You can already write:
import Bar from '@/components/foo/Bar'
IMHO this is even better because it's more explicit that it's from the source code and not from a node_modules package.
Most helpful comment
You can already write:
IMHO this is even better because it's more explicit that it's from the source code and not from a node_modules package.