Refactor js build pipeline