the proper way to do it is the following:
- declare the resource in the Layout.xml file of the style project , assigning a unique name to it (eg. myJS)
The <wr:Resource> tag prints all the necessary resources in the page.
The needed resources are automatically calculated at generation time by WebRatio.
This means that, everytime you use the template requiring the myJs resource, the tag is able to understand it and prints the reference in the generated page.
I suggest you to download some templates from the WebRatio Addons to see how they are written.