minifies, copys, replaces references and uploads to s3