build(templates): refactors main.js template and adds it to watch task