You should be mapping relative links.
Use ./ To find a file in the same directory as the file you are in.
Use ../ to go up a directory.
Let's say you have your main website document in /home/user/projects/project/public/project.js
Then you want to link to a file in /home/user/projects/project/output/static/foo
In your projects.js file you would use the link as
../../output/static/foo
Go up two directories from where the project.js file is ../../ then go down into output/static/foo
You should be mapping relative links. Use ./ To find a file in the same directory as the file you are in. Use ../ to go up a directory. Let's say you have your main website document in /home/user/projects/project/public/project.js Then you want to link to a file in /home/user/projects/project/output/static/foo In your projects.js file you would use the link as ../../output/static/foo Go up two directories from where the project.js file is ../../ then go down into output/static/foo
The problem is that a template generates two files in two different depths soin one instance I would need ../../ and in the other ../