Remove build artifacts in JS build

* Wipe out distribution directory before starting to prevent recursive
  `main.js` creation
Update task path when parent App's ID changes