Search code examples
intellij-ideaphpstormwebstorm

How to mark a directory as library root?


I've 2 projects in PhpStorm: one is working well while another won't work and I can't figure what make the first one working.

The first one is working well with library root for bower, npm and composer :

enter image description here

The second one is bower, npm are not detected as library root : enter image description here

So the behaviour in PhpStorm is different, when I use the navigate file on second project, I see all the vendor file by default :

enter image description here

If I mark the directory as excluded, the ide don't understand the vendor class : enter image description here

So how can we configure the IDE to mark a directory as library root ?


Solution

  • Thanks to @LazyOne comment, found the solution : Select Preferences | Languages & Frameworks | JavaScript | Libraries and click Add. Select the path you want to add and the folder will be marked as library root. Really useful for non standard path (not bower_components for example)