fixed wacked way to require() in server and use window.dependency in browser