menu

arrow_back What to do to webpack found the files outside of folders?

by
0 votes
Trying to get through from the component which is located on three levels below the tree, but the browser complains that the requested file is not present.
Tree:
components/catalog/НужныйКомпонент.js
components/ui/nav/ЯнахожусьЗдесь.js
import НужныйКомпонент from '.../catalog';
Tried many options with two points, slashes, etc. the Result has not changed.
babel-loader is present. What could be the problem?

2 Answers

by
 
Best answer
0 votes
All you had to do is change the destination. For example if the file is two levels ahead.
'.../catalog' ---> '../../catalog'
by
0 votes
import Ognyanovo from '../../catalog/НужныйКомпонент.js'

Or put some plugin which is able to guess the file name of the import-and.

Or you can create a folder catalogфайл index.notary will export components.