This Question is Not Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
6 Replies Last post: Feb 5, 2013 8:01 PM by Mike Suiter  
Mike Suiter Newbie 17 posts since
Feb 4, 2013
Currently Being Moderated

Feb 5, 2013 12:10 AM

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!

Kirill Safonov JetBrains 584 posts since
Jul 9, 2009
Currently Being Moderated
Feb 5, 2013 12:16 AM in response to: Mike Suiter
Re: Working with multiple web apps within project

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

Andriy Bazanov Master 2,652 posts since
May 28, 2010
Currently Being Moderated
Feb 5, 2013 2:39 AM in response to: Mike Suiter
Re: Working with multiple web apps within project

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)

More Like This

  • Retrieving data ...