Working with multiple web apps within project

We have a single project (WAR) that contains multiple JavaScript web apps. So, our project structure is like:

web-project
  |-- WebContent
    |-- JavaScript app A
    |-- JavaScript app B
    |-- JavaScript app C
    |-- common JavaScript



What I want to do is tell WebStorm that I'm working with app A, B, or C. Each of these projects share the common JavaScript folder. The actual folder structure is more complex as each app has files under several different locations, so doing directory includes/excludes will be a pain.

I thought scopes would work and they do to a point like for Find Usages. Other actions like ctrl-click (Choose Declaration) and ctrl-shift-n (Go to file) use the entire project and not the current scope.

How can I tell WebStorm that I want to work with App A and easily switch to App B or App C? Settings > Directories would work but time consuming as we have a complicated file structure (including generated minified testing and production files).

Thanks!
6 comments

Hi Mike,

IDE really considers all your code as part of the same project.
Can you just create 3 separate projects and a fourth one for the library and switch between them (or have multiple windows open at the same time)?

Kirill

0

So I have created a project called web-project-app-a and configured it's folders as Resource Roots. It appears I also have to Exclude all the other folders even though they aren't defined as Resource Roots? Otherwise they show up under ctrl-shift-n etc.

When done, is there a way to clone the web-project-app-a to web-project-app-b and just tweak the folders or do I need to start from scratch?

0

It also appears I can't have 2 different WebStorm projects under the same folder with different names. When I try that it just opens the first project created.

0

Hi Mike,

Yes -- you cannot have it done in straightworward way. The reason -- project settinsg are stored in .idea subfolder -- that's how IDE recognizes the projects. There is a workaround (playing manually with Content Roots and locations) -- create project anywhere else (that's where project settings will be stored), then "Settings | Directories", detach current Content Root and attach new one (desired folder) instead (via "Add Content Root" button).

I do not know at what level/folder you have created your first project, but using Additional Content Roots approach, you can set up project root at lower level and then add additional (completely different) location into the project. For example, if you have created your project at "WebContent" level, then try it at "JavaScript app A" level instead (and add "common Javascript" folder as additional Content Root)

0

This is getting me closer to what I want but the downside is it no longer detects my Subversion source control. When my project and content root was at the top-level it automatically detected Subversion. Any ideas?

0

Figured it out by changing Settings > Version Control and deleting default entry and adding my top-level project.

Several of us our evaluation WebStorm for Sencha Ext JS and Touch development and so far it's great!

0

Please sign in to leave a comment.