first build on a tmp folder, then minimize and move to final dist folder