Preferred way to develop JavaScript library and dependencies concurrently
I'm currently working on a project that involves both a large library (which extends parts of the Google Closure Library) and a number of smaller modules which use this library. I initially tried keeping the library module & child modules as part of the same project, but it seems that for code completion to work, I need to add all of the files from my library to a JavaScript library in my module settings. In order for this to work, I need to keep my library in a separate IDEA project, but this causes problems as I need to keep two IDEA instances open and I have to remember to add any new library files to the library definition for code completion to work.
This really doesn't seem like the correct workflow for what I'd assume is a relatively common use case. In other IDEs I've been able to define my library module as a dependency of the child modules, allowing me to work on them within the same IDE & automatically making sources available for code completion. IDEA seems to handle this correctly when using other languages (ActionScript and Java being the ones that I've tried), it seems like something like that for JavaScript would be ideal. Is there any way I can set up my project to accomplish this in IDEA? If not, what's the best workaround for this scenario?
请先登录再写评论。
Hi Jim,
Just checked that such case work just fine:
Denis
The step I fail at is "Defined 'api' as a module dependency for 'client';" - I'm not sure where I'm supposed to do this. The Project Structure window doesn't have a tab for dependencies when I'm working on a Web project - should I be looking somewhere else?
Sorry, didn't realize that you have a non-java web project.
Created a screencast which illustrates how to do the trick with pure WebStorm - https://dl.dropboxusercontent.com/u/1648086/video/config.m4v
Denis
Thanks for going to the effort of making that video, it's very much appreciated. However, that seems to be the same setup that I have at the moment, which has a couple of issues:
Denis
Denis
That's correct. Most of my work is in JS, but I already have an IntelliJ IDEA license so I've been using it rather than buying a WebStorm license too.
You can just use the module dependency facility then.
Denis
There isn't a dependencies tab in the module settings when I'm in a web project