fix locations conflict, externalize js sources