Improve build script
Handle viewport updates