A
A
ar52018-10-01 16:03:00
JavaScript
ar5, 2018-10-01 16:03:00

How to load a module from another folder?

Hello, there is such a change, there is one file imports.jsthat lies in the folder. The project has a mono-repository structure, so there is a folder packageswhere the packages with their node_modules.
The file imports.jscalls 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

1 answer(s)
A
Anton fon Faust, 2018-10-01
@bubandos

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 question

Ask a Question

731 491 924 answers to any question