build main.js correctly when it is not in a subfolder