Additional "node_modules" lookup directory.


I use WebPack + TypeScript in my project.
We have some libraries in the project that we treat as "packages" for future modularity.

In webpack, I can set a list of lookup directories (other the "node_modules") where external modules are stored.

So, if I do:

import { Something } from 'somePackage';

WebPack will look for a directory 'somePackage' in each of the lookup directories I provided and take the index.ts file from it (or any file provided in packages.json->main)

How can I tell WebStorm to do the same?
Everything works but I have IDE errors and incomplete intellisense because WebStorm does not find 'somePackage' since its not in 'node_modules'

For the time being, I have a workaround, I add a file named 'somePackage.ts' to the root and inside I do export * from ''path/to/somePackage"; , this works and that file is not being bundled into the build but its just useless bolierplate (tough support all IDEs)

Please sign in to leave a comment.