React Webpack 4 Resolve Alias React Webpack 4 Resolve Alias reactjs reactjs

React Webpack 4 Resolve Alias


The only thing I was missing was the dot before /app!

apiAlias: path.resolve(__dirname, './app/services/api/')


What you can do is remove the first '/' in your ApiAccounts import:

import ApiAccounts from 'apiAlias/ApiAccounts.js';

This way your import path start with the key in your alias object, which in your case is apiAlias.