Answer the question
In order to leave comments, you need to log in
How to make webpack find files outside of folders?
I'm trying to reach out from a component that is three levels below the tree, but the browser swears that the required file is not there.
Tree:
components/catalog/DesiredComponent.js
components/ui/nav/I'mHere.js
Tried many options with two dots, slashes, etc. The result hasn't changed.
babel-loader is present. What could be the problem? import НужныйКомпонент from '.../catalog';
Answer the question
In order to leave comments, you need to log in
All we had to do was change the destination. Let's say if the file is two levels ahead.
'.../catalog' ---> '../../catalog'
import RequiredComponent from '../../catalog/RequiredComponent.js'
Or install some plugin that can guess the file name from import.
Or create an index.js file in the catalog folder that will export the components.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question