5 Replies Last post: Jan 23, 2013 11:05 PM by Kirill Safonov  
Guilherme Goncalves Newbie 9 posts since
Sep 11, 2011
Currently Being Moderated

Jan 21, 2013 9:47 AM

Sharing JavaScript files between projects

Hello guys, i have the following problem (simplified for clarity):

file1.js is a file i want to use in my project, the catch here is that i don't want to add this file i want to share this file between different projects (like a library)

I don't want to have different copies of this file for each project that would be using it, i have however fiddle with the javascript library configuration under project settings and added my file as an library

i don't actually know if this is what i need and i found no way to referencing it inside a script tag on my project <script src="????" type="text/javascript"></script> how to do this?

Kirill Safonov JetBrains 584 posts since
Jul 9, 2009
Currently Being Moderated
Jan 21, 2013 5:25 PM in response to: Guilherme Goncalves
Re: Sharing JavaScript files between projects

Hi,

 

Just to clarify - how would this file be served by web server if does not reside under a web root of one of the projects?

 

Kirill

Keith Davis Apprentice 615 posts since
Aug 23, 2010
Currently Being Moderated
Jan 21, 2013 8:45 PM in response to: Guilherme Goncalves
Re: Sharing JavaScript files between projects

That's a good question. I've wanted to do that before myself, but with JS, I have found no reasonable way to make it work.

Andriy Bazanov Master 2,640 posts since
May 28, 2010
Currently Being Moderated
Jan 23, 2013 3:46 AM in response to: Guilherme Goncalves
Re: Sharing JavaScript files between projects

Symbolic link anyone?

 

P.S.

This works perfectly fine with folders, with symlinks on files -- it may be "unlinked" when editing such file (depends on your settings, e.g. "safe write") -- have not tested files myself as there was no need (I'm always organizing my extra stuff in folders).

Kirill Safonov JetBrains 584 posts since
Jul 9, 2009
Currently Being Moderated
Jan 23, 2013 11:05 PM in response to: Guilherme Goncalves
Re: Sharing JavaScript files between projects

OK, so in the end one first needs to choose the way to make it work for the web server. Then we can discuss how can we support this in the IDE.

More Like This

  • Retrieving data ...