Avoid relative import paths in React.js using Webpack aliases

1 · Amit Merchant · Aug. 18, 2021, 5:01 a.m.
Here’s a little tip for your React.js projects that can dramatically improve your developer experience. So, if you have been working with modern JavaScript lately, React.js or anything similar, you might have used relative paths to import modules like so. For instance, let’s say if I want to import a module that is two directories up from the current file location, I would need to import it like so. import Order from '../../components/order'; Now, it kind of works but if you can notice this kin...