Answer the question
In order to leave comments, you need to log in
How to load a module from another folder?
Hello, there is such a change, there is one file imports.js
that lies in the folder. The project has a mono-repository structure, so there is a folder packages
where the packages with their node_modules
.
The file imports.js
calls require("myModule"), but this module is searched relative to the folder where this file is located. Is it possible to make sure that the file is searched relative to the place where it is called, i.e. inside the package?
Answer the question
In order to leave comments, you need to log in
Nothing prevents passing to this module (which is being searched) the path where to search
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question