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?

5 comments
Comment actions Permalink

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

0
Comment actions Permalink

yes that would be part of the problem,  i was wondering if some sort of link could be created between the file and the project where that file is copied to some directory inside the project automatically,  and re-copied upon any changes to the original file

0
Comment actions Permalink

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.

0
Comment actions Permalink

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).

0
Comment actions Permalink

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.

0

Please sign in to leave a comment.