I'd like to configure some webpack aliases to point to some of my folders (not to a lib in node_modules).
Here is a simple example:
var path = require('path');
module.exports = {
webpack: function (config) {
config.resolve.alias = {
'components': path.resolve('./components'),
};
return config
}
}
However, if I try to import a component in a page e.g:
import { NavBar } from 'components';
I get the following error:Error: Cannot find module 'components'
Any idea how to get next to play nice with an alias like this?
I'd like to configure some webpack aliases to point to some of my folders (not to a lib in node_modules).
Here is a simple example:
However, if I try to import a component in a page e.g:
I get the following error:
Error: Cannot find module 'components'Any idea how to get next to play nice with an alias like this?